<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-99.9.9">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">


<title>Fastmath documentation – Core</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
  width: 0.8em;
  margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ 
  vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
  { counter-reset: source-line 0; }
pre.numberSource code > span
  { position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
  { content: counter(source-line);
    position: relative; left: -1em; text-align: right; vertical-align: baseline;
    border: none; display: inline-block;
    -webkit-touch-callout: none; -webkit-user-select: none;
    -khtml-user-select: none; -moz-user-select: none;
    -ms-user-select: none; user-select: none;
    padding: 0 4px; width: 4em;
  }
pre.numberSource { margin-left: 3em;  padding-left: 4px; }
div.sourceCode
  {   }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>


<script src="site_libs/quarto-nav/quarto-nav.js"></script>
<script src="site_libs/quarto-nav/headroom.min.js"></script>
<script src="site_libs/clipboard/clipboard.min.js"></script>
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
<script src="site_libs/quarto-search/fuse.min.js"></script>
<script src="site_libs/quarto-search/quarto-search.js"></script>
<meta name="quarto:offset" content="./">
<link href="./vector_matrix.html" rel="next">
<link href="./index.html" rel="prev">
<link href="./clay/resources/favicon.png" rel="icon" type="image/png">
<script src="site_libs/quarto-html/quarto.js"></script>
<script src="site_libs/quarto-html/popper.min.js"></script>
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
<script src="site_libs/quarto-html/anchor.min.js"></script>
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
<script id="quarto-search-options" type="application/json">{
  "location": "sidebar",
  "copy-button": false,
  "collapse-after": 3,
  "panel-placement": "start",
  "type": "textbox",
  "limit": 50,
  "keyboard-shortcut": [
    "f",
    "/",
    "s"
  ],
  "show-item-context": false,
  "language": {
    "search-no-results-text": "No results",
    "search-matching-documents-text": "matching documents",
    "search-copy-link-title": "Copy link to search",
    "search-hide-matches-text": "Hide additional matches",
    "search-more-match-text": "more match in this document",
    "search-more-matches-text": "more matches in this document",
    "search-clear-button-title": "Clear",
    "search-text-placeholder": "",
    "search-detached-cancel-button-title": "Cancel",
    "search-submit-button-title": "Submit",
    "search-label": "Search"
  }
}</script>

  <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
  <script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script>

<script type="text/javascript">
const typesetMath = (el) => {
  if (window.MathJax) {
    // MathJax Typeset
    window.MathJax.typeset([el]);
  } else if (window.katex) {
    // KaTeX Render
    var mathElements = el.getElementsByClassName("math");
    var macros = [];
    for (var i = 0; i < mathElements.length; i++) {
      var texText = mathElements[i].firstChild;
      if (mathElements[i].tagName == "SPAN") {
        window.katex.render(texText.data, mathElements[i], {
          displayMode: mathElements[i].classList.contains('display'),
          throwOnError: false,
          macros: macros,
          fleqn: false
        });
      }
    }
  }
}
window.Quarto = {
  typesetMath
};
</script>

</head>

<body class="nav-sidebar floating">

<div id="quarto-search-results"></div>
  <header id="quarto-header" class="headroom fixed-top">
  <nav class="quarto-secondary-nav">
    <div class="container-fluid d-flex">
      <button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
        <i class="bi bi-layout-text-sidebar-reverse"></i>
      </button>
        <nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./core.html">Core</a></li></ol></nav>
        <a class="flex-grow-1" role="button" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">      
        </a>
      <button type="button" class="btn quarto-search-button" aria-label="" onclick="window.quartoOpenSearch();">
        <i class="bi bi-search"></i>
      </button>
    </div>
  </nav>
</header>
<!-- content -->
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article">
<!-- sidebar -->
  <nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation floating overflow-auto">
    <div class="pt-lg-2 mt-2 text-left sidebar-header">
    <div class="sidebar-title mb-0 py-0">
      <a href="./">Fastmath documentation</a> 
    </div>
      </div>
        <div class="mt-2 flex-shrink-0 align-items-center">
        <div class="sidebar-search">
        <div id="quarto-search" class="" title="Search"></div>
        </div>
        </div>
    <div class="sidebar-menu-container"> 
    <ul class="list-unstyled mt-1">
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./index.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Preface</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./core.html" class="sidebar-item-text sidebar-link active">
 <span class="menu-text">Core</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./vector_matrix.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Vectors and matrices</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./random.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Random</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./stats.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Statistics</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./polynomials.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Polynomials</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./special.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Special functions</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./calculus.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Calculus</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./interpolation.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Interpolation</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./optimization.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Optimization</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./transform.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Transforms</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./ml.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Machine Learning</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./complex_quaternions.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Complex numbers and quaternions</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./easings.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Easings</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./fields.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Vector fields</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./efloat.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">EFloat</span></a>
  </div>
</li>
    </ul>
    </div>
</nav>
<div id="quarto-sidebar-glass" class="quarto-sidebar-collapse-item" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item"></div>
<!-- margin-sidebar -->
    <div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
        <nav id="TOC" role="doc-toc" class="toc-active">
    <h2 id="toc-title">Table of contents</h2>
   
  <ul>
  <li><a href="#basic-operations" id="toc-basic-operations" class="nav-link active" data-scroll-target="#basic-operations">Basic operations</a>
  <ul>
  <li><a href="#arithmetics" id="toc-arithmetics" class="nav-link" data-scroll-target="#arithmetics">Arithmetics</a></li>
  <li><a href="#remainders" id="toc-remainders" class="nav-link" data-scroll-target="#remainders">Remainders</a></li>
  <li><a href="#min-max-abs" id="toc-min-max-abs" class="nav-link" data-scroll-target="#min-max-abs">Min, max, abs</a>
  <ul>
  <li><a href="#smooth-maximum" id="toc-smooth-maximum" class="nav-link" data-scroll-target="#smooth-maximum">Smooth maximum</a></li>
  </ul></li>
  <li><a href="#fma" id="toc-fma" class="nav-link" data-scroll-target="#fma">fma</a></li>
  </ul></li>
  <li><a href="#rounding" id="toc-rounding" class="nav-link" data-scroll-target="#rounding">Rounding</a></li>
  <li><a href="#sign" id="toc-sign" class="nav-link" data-scroll-target="#sign">Sign</a></li>
  <li><a href="#predicates" id="toc-predicates" class="nav-link" data-scroll-target="#predicates">Predicates</a></li>
  <li><a href="#trigonometry" id="toc-trigonometry" class="nav-link" data-scroll-target="#trigonometry">Trigonometry</a></li>
  <li><a href="#power-and-logarithms" id="toc-power-and-logarithms" class="nav-link" data-scroll-target="#power-and-logarithms">Power and logarithms</a></li>
  <li><a href="#bitwise-operations" id="toc-bitwise-operations" class="nav-link" data-scroll-target="#bitwise-operations">Bitwise operations</a></li>
  <li><a href="#floating-point" id="toc-floating-point" class="nav-link" data-scroll-target="#floating-point">Floating point</a></li>
  <li><a href="#other" id="toc-other" class="nav-link" data-scroll-target="#other">Other</a>
  <ul>
  <li><a href="#gcd-and-lcm" id="toc-gcd-and-lcm" class="nav-link" data-scroll-target="#gcd-and-lcm">GCD and LCM</a></li>
  <li><a href="#combinatorics" id="toc-combinatorics" class="nav-link" data-scroll-target="#combinatorics">Combinatorics</a></li>
  <li><a href="#rank-and-order" id="toc-rank-and-order" class="nav-link" data-scroll-target="#rank-and-order">Rank and order</a></li>
  <li><a href="#sampling" id="toc-sampling" class="nav-link" data-scroll-target="#sampling">Sampling</a></li>
  <li><a href="#interpolation-and-mapping" id="toc-interpolation-and-mapping" class="nav-link" data-scroll-target="#interpolation-and-mapping">Interpolation and mapping</a></li>
  </ul></li>
  <li><a href="#constants" id="toc-constants" class="nav-link" data-scroll-target="#constants">Constants</a></li>
  <li><a href="#reference" id="toc-reference" class="nav-link" data-scroll-target="#reference">Reference</a>
  <ul>
  <li><a href="#fastmath.core" id="toc-fastmath.core" class="nav-link" data-scroll-target="#fastmath.core">fastmath.core</a>
  <ul>
  <li><a href="#section" id="toc-section" class="nav-link" data-scroll-target="#section">*</a></li>
  <li><a href="#section-1" id="toc-section-1" class="nav-link" data-scroll-target="#section-1">+</a></li>
  <li><a href="#section-2" id="toc-section-2" class="nav-link" data-scroll-target="#section-2">-</a></li>
  <li><a href="#e-const" id="toc-e-const" class="nav-link" data-scroll-target="#e-const">-E <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#half_pi-const" id="toc-half_pi-const" class="nav-link" data-scroll-target="#half_pi-const">-HALF_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#pi-const" id="toc-pi-const" class="nav-link" data-scroll-target="#pi-const">-PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#quarter_pi-const" id="toc-quarter_pi-const" class="nav-link" data-scroll-target="#quarter_pi-const">-QUARTER_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#tau-const" id="toc-tau-const" class="nav-link" data-scroll-target="#tau-const">-TAU <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#third_pi-const" id="toc-third_pi-const" class="nav-link" data-scroll-target="#third_pi-const">-THIRD_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#two_pi-const" id="toc-two_pi-const" class="nav-link" data-scroll-target="#two_pi-const">-TWO_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#section-3" id="toc-section-3" class="nav-link" data-scroll-target="#section-3">/</a></li>
  <li><a href="#section-4" id="toc-section-4" class="nav-link" data-scroll-target="#section-4">&lt;</a></li>
  <li><a href="#section-5" id="toc-section-5" class="nav-link" data-scroll-target="#section-5">&lt;&lt;</a></li>
  <li><a href="#section-6" id="toc-section-6" class="nav-link" data-scroll-target="#section-6">&lt;=</a></li>
  <li><a href="#section-7" id="toc-section-7" class="nav-link" data-scroll-target="#section-7">==</a></li>
  <li><a href="#section-8" id="toc-section-8" class="nav-link" data-scroll-target="#section-8">&gt;</a></li>
  <li><a href="#section-9" id="toc-section-9" class="nav-link" data-scroll-target="#section-9">&gt;=</a></li>
  <li><a href="#section-10" id="toc-section-10" class="nav-link" data-scroll-target="#section-10">&gt;&gt;</a></li>
  <li><a href="#section-11" id="toc-section-11" class="nav-link" data-scroll-target="#section-11">&gt;&gt;&gt;</a></li>
  <li><a href="#catalan_g-const" id="toc-catalan_g-const" class="nav-link" data-scroll-target="#catalan_g-const">CATALAN_G <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#e-const-1" id="toc-e-const-1" class="nav-link" data-scroll-target="#e-const-1">E <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#epsilon-const" id="toc-epsilon-const" class="nav-link" data-scroll-target="#epsilon-const">EPSILON <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#four_inv_pi-const" id="toc-four_inv_pi-const" class="nav-link" data-scroll-target="#four_inv_pi-const">FOUR_INV_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#gamma-const" id="toc-gamma-const" class="nav-link" data-scroll-target="#gamma-const">GAMMA <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#half_pi-const-1" id="toc-half_pi-const-1" class="nav-link" data-scroll-target="#half_pi-const-1">HALF_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#inv_four_pi-const" id="toc-inv_four_pi-const" class="nav-link" data-scroll-target="#inv_four_pi-const">INV_FOUR_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#inv_ln2-const" id="toc-inv_ln2-const" class="nav-link" data-scroll-target="#inv_ln2-const">INV_LN2 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#inv_log_half-const" id="toc-inv_log_half-const" class="nav-link" data-scroll-target="#inv_log_half-const">INV_LOG_HALF <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#inv_pi-const" id="toc-inv_pi-const" class="nav-link" data-scroll-target="#inv_pi-const">INV_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#inv_sqrt2pi-const" id="toc-inv_sqrt2pi-const" class="nav-link" data-scroll-target="#inv_sqrt2pi-const">INV_SQRT2PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#inv_sqrtpi-const" id="toc-inv_sqrtpi-const" class="nav-link" data-scroll-target="#inv_sqrtpi-const">INV_SQRTPI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#inv_sqrt_2-const" id="toc-inv_sqrt_2-const" class="nav-link" data-scroll-target="#inv_sqrt_2-const">INV_SQRT_2 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#inv_two_pi-const" id="toc-inv_two_pi-const" class="nav-link" data-scroll-target="#inv_two_pi-const">INV_TWO_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#lanczos_g-const" id="toc-lanczos_g-const" class="nav-link" data-scroll-target="#lanczos_g-const">LANCZOS_G <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#ln10-const" id="toc-ln10-const" class="nav-link" data-scroll-target="#ln10-const">LN10 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#ln2-const" id="toc-ln2-const" class="nav-link" data-scroll-target="#ln2-const">LN2 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#ln2_2-const" id="toc-ln2_2-const" class="nav-link" data-scroll-target="#ln2_2-const">LN2_2 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#log10e-const" id="toc-log10e-const" class="nav-link" data-scroll-target="#log10e-const">LOG10E <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#log2e-const" id="toc-log2e-const" class="nav-link" data-scroll-target="#log2e-const">LOG2E <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#log_half-const" id="toc-log_half-const" class="nav-link" data-scroll-target="#log_half-const">LOG_HALF <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#log_pi-const" id="toc-log_pi-const" class="nav-link" data-scroll-target="#log_pi-const">LOG_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#log_two_pi-const" id="toc-log_two_pi-const" class="nav-link" data-scroll-target="#log_two_pi-const">LOG_TWO_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#machine-epsilon-const" id="toc-machine-epsilon-const" class="nav-link" data-scroll-target="#machine-epsilon-const">MACHINE-EPSILON <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#machine-epsilon10-const" id="toc-machine-epsilon10-const" class="nav-link" data-scroll-target="#machine-epsilon10-const">MACHINE-EPSILON10 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_1_pi-const" id="toc-m_1_pi-const" class="nav-link" data-scroll-target="#m_1_pi-const">M_1_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_2_pi-const" id="toc-m_2_pi-const" class="nav-link" data-scroll-target="#m_2_pi-const">M_2_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_2_sqrtpi-const" id="toc-m_2_sqrtpi-const" class="nav-link" data-scroll-target="#m_2_sqrtpi-const">M_2_SQRTPI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_3pi_4-const" id="toc-m_3pi_4-const" class="nav-link" data-scroll-target="#m_3pi_4-const">M_3PI_4 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_e-const" id="toc-m_e-const" class="nav-link" data-scroll-target="#m_e-const">M_E <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_invln2-const" id="toc-m_invln2-const" class="nav-link" data-scroll-target="#m_invln2-const">M_INVLN2 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_ivln10-const" id="toc-m_ivln10-const" class="nav-link" data-scroll-target="#m_ivln10-const">M_IVLN10 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_ln10-const" id="toc-m_ln10-const" class="nav-link" data-scroll-target="#m_ln10-const">M_LN10 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_ln2-const" id="toc-m_ln2-const" class="nav-link" data-scroll-target="#m_ln2-const">M_LN2 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_log10e-const" id="toc-m_log10e-const" class="nav-link" data-scroll-target="#m_log10e-const">M_LOG10E <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_log2e-const" id="toc-m_log2e-const" class="nav-link" data-scroll-target="#m_log2e-const">M_LOG2E <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_log2_e-const" id="toc-m_log2_e-const" class="nav-link" data-scroll-target="#m_log2_e-const">M_LOG2_E <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_pi-const" id="toc-m_pi-const" class="nav-link" data-scroll-target="#m_pi-const">M_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_pi_2-const" id="toc-m_pi_2-const" class="nav-link" data-scroll-target="#m_pi_2-const">M_PI_2 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_pi_4-const" id="toc-m_pi_4-const" class="nav-link" data-scroll-target="#m_pi_4-const">M_PI_4 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_sqrt1_2-const" id="toc-m_sqrt1_2-const" class="nav-link" data-scroll-target="#m_sqrt1_2-const">M_SQRT1_2 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_sqrt2-const" id="toc-m_sqrt2-const" class="nav-link" data-scroll-target="#m_sqrt2-const">M_SQRT2 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_sqrt3-const" id="toc-m_sqrt3-const" class="nav-link" data-scroll-target="#m_sqrt3-const">M_SQRT3 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_sqrt_pi-const" id="toc-m_sqrt_pi-const" class="nav-link" data-scroll-target="#m_sqrt_pi-const">M_SQRT_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#m_twopi-const" id="toc-m_twopi-const" class="nav-link" data-scroll-target="#m_twopi-const">M_TWOPI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#one_sixth-const" id="toc-one_sixth-const" class="nav-link" data-scroll-target="#one_sixth-const">ONE_SIXTH <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#one_third-const" id="toc-one_third-const" class="nav-link" data-scroll-target="#one_third-const">ONE_THIRD <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#phi-const" id="toc-phi-const" class="nav-link" data-scroll-target="#phi-const">PHI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#pi-const-1" id="toc-pi-const-1" class="nav-link" data-scroll-target="#pi-const-1">PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#quarter_pi-const-1" id="toc-quarter_pi-const-1" class="nav-link" data-scroll-target="#quarter_pi-const-1">QUARTER_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#silver-const" id="toc-silver-const" class="nav-link" data-scroll-target="#silver-const">SILVER <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#sixth-const" id="toc-sixth-const" class="nav-link" data-scroll-target="#sixth-const">SIXTH <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#sqrt2-const" id="toc-sqrt2-const" class="nav-link" data-scroll-target="#sqrt2-const">SQRT2 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#sqrt2pi-const" id="toc-sqrt2pi-const" class="nav-link" data-scroll-target="#sqrt2pi-const">SQRT2PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#sqrt2_2-const" id="toc-sqrt2_2-const" class="nav-link" data-scroll-target="#sqrt2_2-const">SQRT2_2 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#sqrt3-const" id="toc-sqrt3-const" class="nav-link" data-scroll-target="#sqrt3-const">SQRT3 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#sqrt3_2-const" id="toc-sqrt3_2-const" class="nav-link" data-scroll-target="#sqrt3_2-const">SQRT3_2 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#sqrt3_3-const" id="toc-sqrt3_3-const" class="nav-link" data-scroll-target="#sqrt3_3-const">SQRT3_3 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#sqrt3_4-const" id="toc-sqrt3_4-const" class="nav-link" data-scroll-target="#sqrt3_4-const">SQRT3_4 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#sqrt5-const" id="toc-sqrt5-const" class="nav-link" data-scroll-target="#sqrt5-const">SQRT5 <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#sqrtpi-const" id="toc-sqrtpi-const" class="nav-link" data-scroll-target="#sqrtpi-const">SQRTPI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#sqrt_2_pi-const" id="toc-sqrt_2_pi-const" class="nav-link" data-scroll-target="#sqrt_2_pi-const">SQRT_2_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#sqrt_halfpi-const" id="toc-sqrt_halfpi-const" class="nav-link" data-scroll-target="#sqrt_halfpi-const">SQRT_HALFPI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#tau-const-1" id="toc-tau-const-1" class="nav-link" data-scroll-target="#tau-const-1">TAU <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#third-const" id="toc-third-const" class="nav-link" data-scroll-target="#third-const">THIRD <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#third_pi-const-1" id="toc-third_pi-const-1" class="nav-link" data-scroll-target="#third_pi-const-1">THIRD_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#two_inv_pi-const" id="toc-two_inv_pi-const" class="nav-link" data-scroll-target="#two_inv_pi-const">TWO_INV_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#two_pi-const-1" id="toc-two_pi-const-1" class="nav-link" data-scroll-target="#two_pi-const-1">TWO_PI <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#two_third-const" id="toc-two_third-const" class="nav-link" data-scroll-target="#two_third-const">TWO_THIRD <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#two_thirds-const" id="toc-two_thirds-const" class="nav-link" data-scroll-target="#two_thirds-const">TWO_THIRDS <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#abs" id="toc-abs" class="nav-link" data-scroll-target="#abs">abs</a></li>
  <li><a href="#acos" id="toc-acos" class="nav-link" data-scroll-target="#acos">acos</a></li>
  <li><a href="#acosh" id="toc-acosh" class="nav-link" data-scroll-target="#acosh">acosh</a></li>
  <li><a href="#acot" id="toc-acot" class="nav-link" data-scroll-target="#acot">acot</a></li>
  <li><a href="#acoth" id="toc-acoth" class="nav-link" data-scroll-target="#acoth">acoth</a></li>
  <li><a href="#acovercos" id="toc-acovercos" class="nav-link" data-scroll-target="#acovercos">acovercos</a></li>
  <li><a href="#acoversin" id="toc-acoversin" class="nav-link" data-scroll-target="#acoversin">acoversin</a></li>
  <li><a href="#acrd" id="toc-acrd" class="nav-link" data-scroll-target="#acrd">acrd</a></li>
  <li><a href="#acsc" id="toc-acsc" class="nav-link" data-scroll-target="#acsc">acsc</a></li>
  <li><a href="#acsch" id="toc-acsch" class="nav-link" data-scroll-target="#acsch">acsch</a></li>
  <li><a href="#aexcsc" id="toc-aexcsc" class="nav-link" data-scroll-target="#aexcsc">aexcsc</a></li>
  <li><a href="#aexsec" id="toc-aexsec" class="nav-link" data-scroll-target="#aexsec">aexsec</a></li>
  <li><a href="#ahacovercos" id="toc-ahacovercos" class="nav-link" data-scroll-target="#ahacovercos">ahacovercos</a></li>
  <li><a href="#ahacoversin" id="toc-ahacoversin" class="nav-link" data-scroll-target="#ahacoversin">ahacoversin</a></li>
  <li><a href="#ahavercos" id="toc-ahavercos" class="nav-link" data-scroll-target="#ahavercos">ahavercos</a></li>
  <li><a href="#ahaversin" id="toc-ahaversin" class="nav-link" data-scroll-target="#ahaversin">ahaversin</a></li>
  <li><a href="#approx" id="toc-approx" class="nav-link" data-scroll-target="#approx">approx</a></li>
  <li><a href="#approx-eq" id="toc-approx-eq" class="nav-link" data-scroll-target="#approx-eq">approx-eq</a></li>
  <li><a href="#approx-1" id="toc-approx-1" class="nav-link" data-scroll-target="#approx-1">approx=</a></li>
  <li><a href="#asec" id="toc-asec" class="nav-link" data-scroll-target="#asec">asec</a></li>
  <li><a href="#asech" id="toc-asech" class="nav-link" data-scroll-target="#asech">asech</a></li>
  <li><a href="#asin" id="toc-asin" class="nav-link" data-scroll-target="#asin">asin</a></li>
  <li><a href="#asinh" id="toc-asinh" class="nav-link" data-scroll-target="#asinh">asinh</a></li>
  <li><a href="#atan" id="toc-atan" class="nav-link" data-scroll-target="#atan">atan</a></li>
  <li><a href="#atan2" id="toc-atan2" class="nav-link" data-scroll-target="#atan2">atan2</a></li>
  <li><a href="#atanh" id="toc-atanh" class="nav-link" data-scroll-target="#atanh">atanh</a></li>
  <li><a href="#avercos" id="toc-avercos" class="nav-link" data-scroll-target="#avercos">avercos</a></li>
  <li><a href="#aversin" id="toc-aversin" class="nav-link" data-scroll-target="#aversin">aversin</a></li>
  <li><a href="#between-" id="toc-between-" class="nav-link" data-scroll-target="#between-">between-?</a></li>
  <li><a href="#between" id="toc-between" class="nav-link" data-scroll-target="#between">between?</a></li>
  <li><a href="#bit-and" id="toc-bit-and" class="nav-link" data-scroll-target="#bit-and">bit-and</a></li>
  <li><a href="#bit-and-not" id="toc-bit-and-not" class="nav-link" data-scroll-target="#bit-and-not">bit-and-not</a></li>
  <li><a href="#bit-clear" id="toc-bit-clear" class="nav-link" data-scroll-target="#bit-clear">bit-clear</a></li>
  <li><a href="#bit-flip" id="toc-bit-flip" class="nav-link" data-scroll-target="#bit-flip">bit-flip</a></li>
  <li><a href="#bit-nand" id="toc-bit-nand" class="nav-link" data-scroll-target="#bit-nand">bit-nand</a></li>
  <li><a href="#bit-nor" id="toc-bit-nor" class="nav-link" data-scroll-target="#bit-nor">bit-nor</a></li>
  <li><a href="#bit-not" id="toc-bit-not" class="nav-link" data-scroll-target="#bit-not">bit-not</a></li>
  <li><a href="#bit-or" id="toc-bit-or" class="nav-link" data-scroll-target="#bit-or">bit-or</a></li>
  <li><a href="#bit-set" id="toc-bit-set" class="nav-link" data-scroll-target="#bit-set">bit-set</a></li>
  <li><a href="#bit-shift-left" id="toc-bit-shift-left" class="nav-link" data-scroll-target="#bit-shift-left">bit-shift-left</a></li>
  <li><a href="#bit-shift-right" id="toc-bit-shift-right" class="nav-link" data-scroll-target="#bit-shift-right">bit-shift-right</a></li>
  <li><a href="#bit-test" id="toc-bit-test" class="nav-link" data-scroll-target="#bit-test">bit-test</a></li>
  <li><a href="#bit-xnor" id="toc-bit-xnor" class="nav-link" data-scroll-target="#bit-xnor">bit-xnor</a></li>
  <li><a href="#bit-xor" id="toc-bit-xor" class="nav-link" data-scroll-target="#bit-xor">bit-xor</a></li>
  <li><a href="#bits-double" id="toc-bits-double" class="nav-link" data-scroll-target="#bits-double">bits-&gt;double</a></li>
  <li><a href="#bool-not" id="toc-bool-not" class="nav-link" data-scroll-target="#bool-not">bool-not</a></li>
  <li><a href="#bool-xor" id="toc-bool-xor" class="nav-link" data-scroll-target="#bool-xor">bool-xor</a></li>
  <li><a href="#cb" id="toc-cb" class="nav-link" data-scroll-target="#cb">cb</a></li>
  <li><a href="#cbrt" id="toc-cbrt" class="nav-link" data-scroll-target="#cbrt">cbrt</a></li>
  <li><a href="#ceil" id="toc-ceil" class="nav-link" data-scroll-target="#ceil">ceil</a></li>
  <li><a href="#cexpexp" id="toc-cexpexp" class="nav-link" data-scroll-target="#cexpexp">cexpexp</a></li>
  <li><a href="#cloglog" id="toc-cloglog" class="nav-link" data-scroll-target="#cloglog">cloglog</a></li>
  <li><a href="#cnorm" id="toc-cnorm" class="nav-link" data-scroll-target="#cnorm">cnorm</a></li>
  <li><a href="#co-intervals" id="toc-co-intervals" class="nav-link" data-scroll-target="#co-intervals">co-intervals</a></li>
  <li><a href="#combinations" id="toc-combinations" class="nav-link" data-scroll-target="#combinations">combinations</a></li>
  <li><a href="#constrain-macro" id="toc-constrain-macro" class="nav-link" data-scroll-target="#constrain-macro">constrain <sup><sub>MACRO</sub></sup></a></li>
  <li><a href="#copy-sign" id="toc-copy-sign" class="nav-link" data-scroll-target="#copy-sign">copy-sign</a></li>
  <li><a href="#cos" id="toc-cos" class="nav-link" data-scroll-target="#cos">cos</a></li>
  <li><a href="#cos-interpolation" id="toc-cos-interpolation" class="nav-link" data-scroll-target="#cos-interpolation">cos-interpolation</a></li>
  <li><a href="#cosh" id="toc-cosh" class="nav-link" data-scroll-target="#cosh">cosh</a></li>
  <li><a href="#cospi" id="toc-cospi" class="nav-link" data-scroll-target="#cospi">cospi</a></li>
  <li><a href="#cot" id="toc-cot" class="nav-link" data-scroll-target="#cot">cot</a></li>
  <li><a href="#coth" id="toc-coth" class="nav-link" data-scroll-target="#coth">coth</a></li>
  <li><a href="#cotpi" id="toc-cotpi" class="nav-link" data-scroll-target="#cotpi">cotpi</a></li>
  <li><a href="#covercos" id="toc-covercos" class="nav-link" data-scroll-target="#covercos">covercos</a></li>
  <li><a href="#coversin" id="toc-coversin" class="nav-link" data-scroll-target="#coversin">coversin</a></li>
  <li><a href="#crd" id="toc-crd" class="nav-link" data-scroll-target="#crd">crd</a></li>
  <li><a href="#csc" id="toc-csc" class="nav-link" data-scroll-target="#csc">csc</a></li>
  <li><a href="#csch" id="toc-csch" class="nav-link" data-scroll-target="#csch">csch</a></li>
  <li><a href="#cscpi" id="toc-cscpi" class="nav-link" data-scroll-target="#cscpi">cscpi</a></li>
  <li><a href="#cut" id="toc-cut" class="nav-link" data-scroll-target="#cut">cut</a></li>
  <li><a href="#dec" id="toc-dec" class="nav-link" data-scroll-target="#dec">dec</a></li>
  <li><a href="#deg-in-rad-const" id="toc-deg-in-rad-const" class="nav-link" data-scroll-target="#deg-in-rad-const">deg-in-rad <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#degrees" id="toc-degrees" class="nav-link" data-scroll-target="#degrees">degrees</a></li>
  <li><a href="#delta-eq" id="toc-delta-eq" class="nav-link" data-scroll-target="#delta-eq">delta-eq</a></li>
  <li><a href="#delta" id="toc-delta" class="nav-link" data-scroll-target="#delta">delta=</a></li>
  <li><a href="#difference-of-products" id="toc-difference-of-products" class="nav-link" data-scroll-target="#difference-of-products">difference-of-products</a></li>
  <li><a href="#dist" id="toc-dist" class="nav-link" data-scroll-target="#dist">dist</a></li>
  <li><a href="#double-array-seq" id="toc-double-array-seq" class="nav-link" data-scroll-target="#double-array-seq">double-array-&gt;seq</a></li>
  <li><a href="#double-array-type" id="toc-double-array-type" class="nav-link" data-scroll-target="#double-array-type">double-array-type</a></li>
  <li><a href="#double-bits" id="toc-double-bits" class="nav-link" data-scroll-target="#double-bits">double-bits</a></li>
  <li><a href="#double-double-array-seq" id="toc-double-double-array-seq" class="nav-link" data-scroll-target="#double-double-array-seq">double-double-array-&gt;seq</a></li>
  <li><a href="#double-double-array-type" id="toc-double-double-array-type" class="nav-link" data-scroll-target="#double-double-array-type">double-double-array-type</a></li>
  <li><a href="#double-exponent" id="toc-double-exponent" class="nav-link" data-scroll-target="#double-exponent">double-exponent</a></li>
  <li><a href="#double-high-bits" id="toc-double-high-bits" class="nav-link" data-scroll-target="#double-high-bits">double-high-bits</a></li>
  <li><a href="#double-low-bits" id="toc-double-low-bits" class="nav-link" data-scroll-target="#double-low-bits">double-low-bits</a></li>
  <li><a href="#double-one-minus-epsilon-const" id="toc-double-one-minus-epsilon-const" class="nav-link" data-scroll-target="#double-one-minus-epsilon-const">double-one-minus-epsilon <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#double-significand" id="toc-double-significand" class="nav-link" data-scroll-target="#double-significand">double-significand</a></li>
  <li><a href="#eq" id="toc-eq" class="nav-link" data-scroll-target="#eq">eq</a></li>
  <li><a href="#even" id="toc-even" class="nav-link" data-scroll-target="#even">even?</a></li>
  <li><a href="#excsc" id="toc-excsc" class="nav-link" data-scroll-target="#excsc">excsc</a></li>
  <li><a href="#exp" id="toc-exp" class="nav-link" data-scroll-target="#exp">exp</a></li>
  <li><a href="#expexp" id="toc-expexp" class="nav-link" data-scroll-target="#expexp">expexp</a></li>
  <li><a href="#expm1" id="toc-expm1" class="nav-link" data-scroll-target="#expm1">expm1</a></li>
  <li><a href="#exsec" id="toc-exsec" class="nav-link" data-scroll-target="#exsec">exsec</a></li>
  <li><a href="#factorial" id="toc-factorial" class="nav-link" data-scroll-target="#factorial">factorial</a></li>
  <li><a href="#factorial20" id="toc-factorial20" class="nav-link" data-scroll-target="#factorial20">factorial20</a></li>
  <li><a href="#falling-factorial" id="toc-falling-factorial" class="nav-link" data-scroll-target="#falling-factorial">falling-factorial</a></li>
  <li><a href="#falling-factorial-int" id="toc-falling-factorial-int" class="nav-link" data-scroll-target="#falling-factorial-int">falling-factorial-int</a></li>
  <li><a href="#fast-deprecated" id="toc-fast-deprecated" class="nav-link" data-scroll-target="#fast-deprecated">fast* <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#fast-deprecated-1" id="toc-fast-deprecated-1" class="nav-link" data-scroll-target="#fast-deprecated-1">fast+ <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#fast--deprecated" id="toc-fast--deprecated" class="nav-link" data-scroll-target="#fast--deprecated">fast- <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#fast-div-deprecated" id="toc-fast-div-deprecated" class="nav-link" data-scroll-target="#fast-div-deprecated">fast-div <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#fast-identity-deprecated" id="toc-fast-identity-deprecated" class="nav-link" data-scroll-target="#fast-identity-deprecated">fast-identity <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#fast-max-deprecated" id="toc-fast-max-deprecated" class="nav-link" data-scroll-target="#fast-max-deprecated">fast-max <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#fast-min-deprecated" id="toc-fast-min-deprecated" class="nav-link" data-scroll-target="#fast-min-deprecated">fast-min <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#floor" id="toc-floor" class="nav-link" data-scroll-target="#floor">floor</a></li>
  <li><a href="#fma-1" id="toc-fma-1" class="nav-link" data-scroll-target="#fma-1">fma</a></li>
  <li><a href="#fpow" id="toc-fpow" class="nav-link" data-scroll-target="#fpow">fpow</a></li>
  <li><a href="#frac" id="toc-frac" class="nav-link" data-scroll-target="#frac">frac</a></li>
  <li><a href="#gcd" id="toc-gcd" class="nav-link" data-scroll-target="#gcd">gcd</a></li>
  <li><a href="#group-by-intervals" id="toc-group-by-intervals" class="nav-link" data-scroll-target="#group-by-intervals">group-by-intervals</a></li>
  <li><a href="#hacovercos" id="toc-hacovercos" class="nav-link" data-scroll-target="#hacovercos">hacovercos</a></li>
  <li><a href="#hacoversin" id="toc-hacoversin" class="nav-link" data-scroll-target="#hacoversin">hacoversin</a></li>
  <li><a href="#havercos" id="toc-havercos" class="nav-link" data-scroll-target="#havercos">havercos</a></li>
  <li><a href="#haversin" id="toc-haversin" class="nav-link" data-scroll-target="#haversin">haversin</a></li>
  <li><a href="#haversine" id="toc-haversine" class="nav-link" data-scroll-target="#haversine">haversine</a></li>
  <li><a href="#haversine-dist" id="toc-haversine-dist" class="nav-link" data-scroll-target="#haversine-dist">haversine-dist</a></li>
  <li><a href="#high-2-exp" id="toc-high-2-exp" class="nav-link" data-scroll-target="#high-2-exp">high-2-exp</a></li>
  <li><a href="#high-exp" id="toc-high-exp" class="nav-link" data-scroll-target="#high-exp">high-exp</a></li>
  <li><a href="#hypot" id="toc-hypot" class="nav-link" data-scroll-target="#hypot">hypot</a></li>
  <li><a href="#hypot-sqrt" id="toc-hypot-sqrt" class="nav-link" data-scroll-target="#hypot-sqrt">hypot-sqrt</a></li>
  <li><a href="#iabs-deprecated" id="toc-iabs-deprecated" class="nav-link" data-scroll-target="#iabs-deprecated">iabs <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#identity-double" id="toc-identity-double" class="nav-link" data-scroll-target="#identity-double">identity-double</a></li>
  <li><a href="#identity-long" id="toc-identity-long" class="nav-link" data-scroll-target="#identity-long">identity-long</a></li>
  <li><a href="#inc" id="toc-inc" class="nav-link" data-scroll-target="#inc">inc</a></li>
  <li><a href="#inf" id="toc-inf" class="nav-link" data-scroll-target="#inf">inf?</a></li>
  <li><a href="#integer" id="toc-integer" class="nav-link" data-scroll-target="#integer">integer?</a></li>
  <li><a href="#inv-factorial" id="toc-inv-factorial" class="nav-link" data-scroll-target="#inv-factorial">inv-factorial</a></li>
  <li><a href="#invalid-double" id="toc-invalid-double" class="nav-link" data-scroll-target="#invalid-double">invalid-double?</a></li>
  <li><a href="#itrunc" id="toc-itrunc" class="nav-link" data-scroll-target="#itrunc">itrunc</a></li>
  <li><a href="#jvm-version-const" id="toc-jvm-version-const" class="nav-link" data-scroll-target="#jvm-version-const">jvm-version <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#lcm" id="toc-lcm" class="nav-link" data-scroll-target="#lcm">lcm</a></li>
  <li><a href="#lerp" id="toc-lerp" class="nav-link" data-scroll-target="#lerp">lerp</a></li>
  <li><a href="#ln" id="toc-ln" class="nav-link" data-scroll-target="#ln">ln</a></li>
  <li><a href="#log" id="toc-log" class="nav-link" data-scroll-target="#log">log</a></li>
  <li><a href="#log-combinations" id="toc-log-combinations" class="nav-link" data-scroll-target="#log-combinations">log-combinations</a></li>
  <li><a href="#log-factorial" id="toc-log-factorial" class="nav-link" data-scroll-target="#log-factorial">log-factorial</a></li>
  <li><a href="#log10" id="toc-log10" class="nav-link" data-scroll-target="#log10">log10</a></li>
  <li><a href="#log1mexp" id="toc-log1mexp" class="nav-link" data-scroll-target="#log1mexp">log1mexp</a></li>
  <li><a href="#log1p" id="toc-log1p" class="nav-link" data-scroll-target="#log1p">log1p</a></li>
  <li><a href="#log1pexp" id="toc-log1pexp" class="nav-link" data-scroll-target="#log1pexp">log1pexp</a></li>
  <li><a href="#log1pmx" id="toc-log1pmx" class="nav-link" data-scroll-target="#log1pmx">log1pmx</a></li>
  <li><a href="#log1psq" id="toc-log1psq" class="nav-link" data-scroll-target="#log1psq">log1psq</a></li>
  <li><a href="#log2" id="toc-log2" class="nav-link" data-scroll-target="#log2">log2</a></li>
  <li><a href="#log2int" id="toc-log2int" class="nav-link" data-scroll-target="#log2int">log2int</a></li>
  <li><a href="#log2mexp" id="toc-log2mexp" class="nav-link" data-scroll-target="#log2mexp">log2mexp</a></li>
  <li><a href="#logaddexp" id="toc-logaddexp" class="nav-link" data-scroll-target="#logaddexp">logaddexp</a></li>
  <li><a href="#logb" id="toc-logb" class="nav-link" data-scroll-target="#logb">logb</a></li>
  <li><a href="#logcosh" id="toc-logcosh" class="nav-link" data-scroll-target="#logcosh">logcosh</a></li>
  <li><a href="#logexpm1" id="toc-logexpm1" class="nav-link" data-scroll-target="#logexpm1">logexpm1</a></li>
  <li><a href="#logistic" id="toc-logistic" class="nav-link" data-scroll-target="#logistic">logistic</a></li>
  <li><a href="#logit" id="toc-logit" class="nav-link" data-scroll-target="#logit">logit</a></li>
  <li><a href="#loglog" id="toc-loglog" class="nav-link" data-scroll-target="#loglog">loglog</a></li>
  <li><a href="#logmxp1" id="toc-logmxp1" class="nav-link" data-scroll-target="#logmxp1">logmxp1</a></li>
  <li><a href="#logsubexp" id="toc-logsubexp" class="nav-link" data-scroll-target="#logsubexp">logsubexp</a></li>
  <li><a href="#logsumexp" id="toc-logsumexp" class="nav-link" data-scroll-target="#logsumexp">logsumexp</a></li>
  <li><a href="#long-abs" id="toc-long-abs" class="nav-link" data-scroll-target="#long-abs">long-abs</a></li>
  <li><a href="#long-add" id="toc-long-add" class="nav-link" data-scroll-target="#long-add">long-add</a></li>
  <li><a href="#long-dec" id="toc-long-dec" class="nav-link" data-scroll-target="#long-dec">long-dec</a></li>
  <li><a href="#long-div" id="toc-long-div" class="nav-link" data-scroll-target="#long-div">long-div</a></li>
  <li><a href="#long-inc" id="toc-long-inc" class="nav-link" data-scroll-target="#long-inc">long-inc</a></li>
  <li><a href="#long-max" id="toc-long-max" class="nav-link" data-scroll-target="#long-max">long-max</a></li>
  <li><a href="#long-min" id="toc-long-min" class="nav-link" data-scroll-target="#long-min">long-min</a></li>
  <li><a href="#long-mod" id="toc-long-mod" class="nav-link" data-scroll-target="#long-mod">long-mod</a></li>
  <li><a href="#long-mult" id="toc-long-mult" class="nav-link" data-scroll-target="#long-mult">long-mult</a></li>
  <li><a href="#long-quot" id="toc-long-quot" class="nav-link" data-scroll-target="#long-quot">long-quot</a></li>
  <li><a href="#long-rem" id="toc-long-rem" class="nav-link" data-scroll-target="#long-rem">long-rem</a></li>
  <li><a href="#long-sub" id="toc-long-sub" class="nav-link" data-scroll-target="#long-sub">long-sub</a></li>
  <li><a href="#low-2-exp" id="toc-low-2-exp" class="nav-link" data-scroll-target="#low-2-exp">low-2-exp</a></li>
  <li><a href="#low-exp" id="toc-low-exp" class="nav-link" data-scroll-target="#low-exp">low-exp</a></li>
  <li><a href="#make-norm" id="toc-make-norm" class="nav-link" data-scroll-target="#make-norm">make-norm</a></li>
  <li><a href="#max" id="toc-max" class="nav-link" data-scroll-target="#max">max</a></li>
  <li><a href="#min" id="toc-min" class="nav-link" data-scroll-target="#min">min</a></li>
  <li><a href="#mlerp-macro" id="toc-mlerp-macro" class="nav-link" data-scroll-target="#mlerp-macro">mlerp <sup><sub>MACRO</sub></sup></a></li>
  <li><a href="#mnorm-macro" id="toc-mnorm-macro" class="nav-link" data-scroll-target="#mnorm-macro">mnorm <sup><sub>MACRO</sub></sup></a></li>
  <li><a href="#mod" id="toc-mod" class="nav-link" data-scroll-target="#mod">mod</a></li>
  <li><a href="#muladd" id="toc-muladd" class="nav-link" data-scroll-target="#muladd">muladd</a></li>
  <li><a href="#nan" id="toc-nan" class="nav-link" data-scroll-target="#nan">nan?</a></li>
  <li><a href="#near-zero" id="toc-near-zero" class="nav-link" data-scroll-target="#near-zero">near-zero?</a></li>
  <li><a href="#neg-inf" id="toc-neg-inf" class="nav-link" data-scroll-target="#neg-inf">neg-inf?</a></li>
  <li><a href="#neg" id="toc-neg" class="nav-link" data-scroll-target="#neg">neg?</a></li>
  <li><a href="#negative-zero" id="toc-negative-zero" class="nav-link" data-scroll-target="#negative-zero">negative-zero?</a></li>
  <li><a href="#negmuladd" id="toc-negmuladd" class="nav-link" data-scroll-target="#negmuladd">negmuladd</a></li>
  <li><a href="#next-double" id="toc-next-double" class="nav-link" data-scroll-target="#next-double">next-double</a></li>
  <li><a href="#norm" id="toc-norm" class="nav-link" data-scroll-target="#norm">norm</a></li>
  <li><a href="#not-neg" id="toc-not-neg" class="nav-link" data-scroll-target="#not-neg">not-neg?</a></li>
  <li><a href="#not-pos" id="toc-not-pos" class="nav-link" data-scroll-target="#not-pos">not-pos?</a></li>
  <li><a href="#not" id="toc-not" class="nav-link" data-scroll-target="#not">not==</a></li>
  <li><a href="#odd" id="toc-odd" class="nav-link" data-scroll-target="#odd">odd?</a></li>
  <li><a href="#one" id="toc-one" class="nav-link" data-scroll-target="#one">one?</a></li>
  <li><a href="#order" id="toc-order" class="nav-link" data-scroll-target="#order">order</a></li>
  <li><a href="#pos-inf" id="toc-pos-inf" class="nav-link" data-scroll-target="#pos-inf">pos-inf?</a></li>
  <li><a href="#pos" id="toc-pos" class="nav-link" data-scroll-target="#pos">pos?</a></li>
  <li><a href="#pow" id="toc-pow" class="nav-link" data-scroll-target="#pow">pow</a></li>
  <li><a href="#pow2" id="toc-pow2" class="nav-link" data-scroll-target="#pow2">pow2</a></li>
  <li><a href="#pow3" id="toc-pow3" class="nav-link" data-scroll-target="#pow3">pow3</a></li>
  <li><a href="#prev-double" id="toc-prev-double" class="nav-link" data-scroll-target="#prev-double">prev-double</a></li>
  <li><a href="#qceil" id="toc-qceil" class="nav-link" data-scroll-target="#qceil">qceil</a></li>
  <li><a href="#qcos" id="toc-qcos" class="nav-link" data-scroll-target="#qcos">qcos</a></li>
  <li><a href="#qdist" id="toc-qdist" class="nav-link" data-scroll-target="#qdist">qdist</a></li>
  <li><a href="#qexp" id="toc-qexp" class="nav-link" data-scroll-target="#qexp">qexp</a></li>
  <li><a href="#qfloor" id="toc-qfloor" class="nav-link" data-scroll-target="#qfloor">qfloor</a></li>
  <li><a href="#qlog" id="toc-qlog" class="nav-link" data-scroll-target="#qlog">qlog</a></li>
  <li><a href="#qpow" id="toc-qpow" class="nav-link" data-scroll-target="#qpow">qpow</a></li>
  <li><a href="#qround" id="toc-qround" class="nav-link" data-scroll-target="#qround">qround</a></li>
  <li><a href="#qsin" id="toc-qsin" class="nav-link" data-scroll-target="#qsin">qsin</a></li>
  <li><a href="#qsqrt" id="toc-qsqrt" class="nav-link" data-scroll-target="#qsqrt">qsqrt</a></li>
  <li><a href="#quad-interpolation" id="toc-quad-interpolation" class="nav-link" data-scroll-target="#quad-interpolation">quad-interpolation</a></li>
  <li><a href="#quot" id="toc-quot" class="nav-link" data-scroll-target="#quot">quot</a></li>
  <li><a href="#rad-in-deg-const" id="toc-rad-in-deg-const" class="nav-link" data-scroll-target="#rad-in-deg-const">rad-in-deg <sup><sub>CONST</sub></sup></a></li>
  <li><a href="#radians" id="toc-radians" class="nav-link" data-scroll-target="#radians">radians</a></li>
  <li><a href="#rank" id="toc-rank" class="nav-link" data-scroll-target="#rank">rank</a></li>
  <li><a href="#rank1" id="toc-rank1" class="nav-link" data-scroll-target="#rank1">rank1</a></li>
  <li><a href="#rem" id="toc-rem" class="nav-link" data-scroll-target="#rem">rem</a></li>
  <li><a href="#remainder" id="toc-remainder" class="nav-link" data-scroll-target="#remainder">remainder</a></li>
  <li><a href="#rint" id="toc-rint" class="nav-link" data-scroll-target="#rint">rint</a></li>
  <li><a href="#rising-factorial" id="toc-rising-factorial" class="nav-link" data-scroll-target="#rising-factorial">rising-factorial</a></li>
  <li><a href="#rising-factorial-int" id="toc-rising-factorial-int" class="nav-link" data-scroll-target="#rising-factorial-int">rising-factorial-int</a></li>
  <li><a href="#round" id="toc-round" class="nav-link" data-scroll-target="#round">round</a></li>
  <li><a href="#round-even" id="toc-round-even" class="nav-link" data-scroll-target="#round-even">round-even</a></li>
  <li><a href="#round-up-pow2" id="toc-round-up-pow2" class="nav-link" data-scroll-target="#round-up-pow2">round-up-pow2</a></li>
  <li><a href="#rqsqrt" id="toc-rqsqrt" class="nav-link" data-scroll-target="#rqsqrt">rqsqrt</a></li>
  <li><a href="#safe-sqrt" id="toc-safe-sqrt" class="nav-link" data-scroll-target="#safe-sqrt">safe-sqrt</a></li>
  <li><a href="#sample" id="toc-sample" class="nav-link" data-scroll-target="#sample">sample</a></li>
  <li><a href="#sec" id="toc-sec" class="nav-link" data-scroll-target="#sec">sec</a></li>
  <li><a href="#sech" id="toc-sech" class="nav-link" data-scroll-target="#sech">sech</a></li>
  <li><a href="#secpi" id="toc-secpi" class="nav-link" data-scroll-target="#secpi">secpi</a></li>
  <li><a href="#seq-double-array" id="toc-seq-double-array" class="nav-link" data-scroll-target="#seq-double-array">seq-&gt;double-array</a></li>
  <li><a href="#seq-double-double-array" id="toc-seq-double-double-array" class="nav-link" data-scroll-target="#seq-double-double-array">seq-&gt;double-double-array</a></li>
  <li><a href="#sfrac" id="toc-sfrac" class="nav-link" data-scroll-target="#sfrac">sfrac</a></li>
  <li><a href="#sgn" id="toc-sgn" class="nav-link" data-scroll-target="#sgn">sgn</a></li>
  <li><a href="#sigmoid" id="toc-sigmoid" class="nav-link" data-scroll-target="#sigmoid">sigmoid</a></li>
  <li><a href="#signum" id="toc-signum" class="nav-link" data-scroll-target="#signum">signum</a></li>
  <li><a href="#sin" id="toc-sin" class="nav-link" data-scroll-target="#sin">sin</a></li>
  <li><a href="#sinc" id="toc-sinc" class="nav-link" data-scroll-target="#sinc">sinc</a></li>
  <li><a href="#sinh" id="toc-sinh" class="nav-link" data-scroll-target="#sinh">sinh</a></li>
  <li><a href="#sinpi" id="toc-sinpi" class="nav-link" data-scroll-target="#sinpi">sinpi</a></li>
  <li><a href="#slice-range" id="toc-slice-range" class="nav-link" data-scroll-target="#slice-range">slice-range</a></li>
  <li><a href="#smooth-interpolation" id="toc-smooth-interpolation" class="nav-link" data-scroll-target="#smooth-interpolation">smooth-interpolation</a></li>
  <li><a href="#smooth-max" id="toc-smooth-max" class="nav-link" data-scroll-target="#smooth-max">smooth-max</a></li>
  <li><a href="#smoothstep" id="toc-smoothstep" class="nav-link" data-scroll-target="#smoothstep">smoothstep</a></li>
  <li><a href="#sq" id="toc-sq" class="nav-link" data-scroll-target="#sq">sq</a></li>
  <li><a href="#sqrt" id="toc-sqrt" class="nav-link" data-scroll-target="#sqrt">sqrt</a></li>
  <li><a href="#sum-of-products" id="toc-sum-of-products" class="nav-link" data-scroll-target="#sum-of-products">sum-of-products</a></li>
  <li><a href="#tan" id="toc-tan" class="nav-link" data-scroll-target="#tan">tan</a></li>
  <li><a href="#tanh" id="toc-tanh" class="nav-link" data-scroll-target="#tanh">tanh</a></li>
  <li><a href="#tanpi" id="toc-tanpi" class="nav-link" data-scroll-target="#tanpi">tanpi</a></li>
  <li><a href="#trunc" id="toc-trunc" class="nav-link" data-scroll-target="#trunc">trunc</a></li>
  <li><a href="#ulp" id="toc-ulp" class="nav-link" data-scroll-target="#ulp">ulp</a></li>
  <li><a href="#unsigned-bit-shift-right" id="toc-unsigned-bit-shift-right" class="nav-link" data-scroll-target="#unsigned-bit-shift-right">unsigned-bit-shift-right</a></li>
  <li><a href="#unuse-primitive-operators" id="toc-unuse-primitive-operators" class="nav-link" data-scroll-target="#unuse-primitive-operators">unuse-primitive-operators</a></li>
  <li><a href="#use-primitive-operators" id="toc-use-primitive-operators" class="nav-link" data-scroll-target="#use-primitive-operators">use-primitive-operators</a></li>
  <li><a href="#valid-double" id="toc-valid-double" class="nav-link" data-scroll-target="#valid-double">valid-double?</a></li>
  <li><a href="#vercos" id="toc-vercos" class="nav-link" data-scroll-target="#vercos">vercos</a></li>
  <li><a href="#versin" id="toc-versin" class="nav-link" data-scroll-target="#versin">versin</a></li>
  <li><a href="#wrap" id="toc-wrap" class="nav-link" data-scroll-target="#wrap">wrap</a></li>
  <li><a href="#xexpx" id="toc-xexpx" class="nav-link" data-scroll-target="#xexpx">xexpx</a></li>
  <li><a href="#xexpy" id="toc-xexpy" class="nav-link" data-scroll-target="#xexpy">xexpy</a></li>
  <li><a href="#xlog1py" id="toc-xlog1py" class="nav-link" data-scroll-target="#xlog1py">xlog1py</a></li>
  <li><a href="#xlogx" id="toc-xlogx" class="nav-link" data-scroll-target="#xlogx">xlogx</a></li>
  <li><a href="#xlogy" id="toc-xlogy" class="nav-link" data-scroll-target="#xlogy">xlogy</a></li>
  <li><a href="#xor" id="toc-xor" class="nav-link" data-scroll-target="#xor">xor</a></li>
  <li><a href="#zero" id="toc-zero" class="nav-link" data-scroll-target="#zero">zero?</a></li>
  </ul></li>
  </ul></li>
  </ul>
</nav>
    </div>
<!-- main -->
<main class="content" id="quarto-document-content">

<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">Core</h1>
</div>



<div class="quarto-title-meta">

    
  
    
  </div>
  


</header>


<style></style>
<style>.printedClojure .sourceCode {
  background-color: transparent;
  border-style: none;
}
</style>
<style>.clay-limit-image-width .clay-image {max-width: 100%}
.clay-side-by-side .sourceCode {margin: 0}
.clay-side-by-side {margin: 1em 0}
</style>
<script src="core_files/md-default15.js" type="text/javascript"></script>
<script src="core_files/md-default16.js" type="text/javascript"></script>
<p>Collection of type hinted math macros and functions. Partially backed by Java static functions and exposed as macros. They are prepared to accept primitive long or double arguments and return long or double only.</p>
<p>There is a possibility to replace <code>clojure.core</code> functions with a selection of <code>fastmath.core</code> macros. Call:</p>
<ul>
<li><code>(m/use-primitive-operators)</code> to replace functions with macros</li>
<li><code>(m/unuse-primitive-operators)</code> to revert replacement.</li>
</ul>
<p>Be aware that there are some differences and <code>fastmath.core</code> versions shoudn’t be treated as a drop-in replacement for <code>clojure.core</code> versions. Also, since Clojure 1.12, always call <code>unuse-primitive-operators</code> at the end of the namespace.</p>
<p>Here is the complete list of replaced functions:</p>
<ul>
<li><code>* + - /</code></li>
<li><code>&gt; &lt; &gt;= &lt;= ==</code></li>
<li><code>rem quot mod</code></li>
<li><code>bit-or bit-and bit-xor bit-not bit-and-not</code></li>
<li><code>bit-shift-left bit-shift-right unsigned-bit-shift-right</code></li>
<li><code>bit-set bit-clear bit-flip bit-test</code></li>
<li><code>inc dec</code></li>
<li><code>zero? neg? pos? even? odd?</code></li>
<li><code>min max</code></li>
<li><code>abs</code></li>
</ul>
<div class="sourceClojure">
<div class="sourceCode" id="cb1"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>(<span class="kw">require</span> '[fastmath.core <span class="at">:as</span> m])</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<section id="basic-operations" class="level2">
<h2 class="anchored" data-anchor-id="basic-operations">Basic operations</h2>
<p>Basic math operations.</p>
<p>When used in an expression oprations are inlined and can accept mixture of <code>long</code> and <code>double</code> values. If all values are of <code>long</code> primitive type, <code>long</code> is returned, <code>double</code> otherwise.</p>
<p>When used in higher order function, <code>double</code> is returned always. To operate on <code>long</code> primitive type, reach for <code>long-</code> versions.</p>
<div class="callout callout-style-default callout-tip callout-titled" title="Defined functions">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Defined functions
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, <code>quot</code></li>
<li><code>inc</code>, <code>dec</code></li>
<li><code>min</code>, <code>max</code>, <code>smooth-max</code></li>
<li><code>rem</code>, <code>mod</code>, <code>remainder</code>, <code>wrap</code></li>
<li><code>abs</code></li>
</ul>
<p><code>long</code> versions</p>
<ul>
<li><code>long-add</code>, <code>long-sub</code>, <code>long-mult</code>, <code>long-div</code>, <code>long-quot</code></li>
<li><code>long-inc</code>, <code>long-dec</code></li>
<li><code>long-min</code>, <code>long-max</code></li>
<li><code>long-rem</code>, <code>long-quot</code>, <code>long-mod</code></li>
<li><code>long-abs</code></li>
</ul>
</div>
</div>
<section id="arithmetics" class="level3">
<h3 class="anchored" data-anchor-id="arithmetics">Arithmetics</h3>
<ul>
<li>addition, incrementation</li>
<li>subtraction, decrementation</li>
<li>multiplication</li>
<li>division</li>
</ul>
<div class="callout callout-style-default callout-warning callout-titled" title="Division differences">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Division differences
</div>
</div>
<div class="callout-body-container callout-body">
<p>Please note that there some differences between division in <code>fastmath</code> and <code>clojure.core</code></p>
<ul>
<li>when called with one argument (<code>double</code> or <code>long</code>) <code>m//</code> always returns reciprocal (<code>clojure.core//</code> returns a ratio)</li>
<li>when called on <code>long</code> arguments, <code>m//</code> is a long division (<code>clojure.core//</code> returns a ratio)</li>
<li><code>m//</code> for two <code>long</code> arguments is equivalent to <code>m/quot</code></li>
</ul>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<p>Addition</p>
<div class="sourceClojure">
<div class="sourceCode" id="cb2"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>(m/+) <span class="co">;; =&gt; 0.0</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>(m/+ <span class="dv">1</span> <span class="dv">2</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; 10</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a>(m/+ <span class="fl">1.0</span> <span class="fl">2.5</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; 10.5</span></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a>(<span class="kw">reduce</span> m/+ [<span class="dv">1</span> <span class="dv">2</span> <span class="dv">3</span>]) <span class="co">;; =&gt; 6.0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="sourceClojure">
<div class="sourceCode" id="cb3"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>(m/long-add) <span class="co">;; =&gt; 0</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>(m/long-add <span class="dv">1</span> <span class="dv">2</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; 10</span></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a>(m/long-add <span class="fl">1.0</span> <span class="fl">2.5</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; 10</span></span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a>(<span class="kw">reduce</span> m/long-add [<span class="dv">1</span> <span class="dv">2</span> <span class="fl">3.5</span>]) <span class="co">;; =&gt; 6</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>Subtraction</p>
<div class="sourceClojure">
<div class="sourceCode" id="cb4"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>[(m/- <span class="dv">1</span>) (m/- <span class="fl">1.0</span>)] <span class="co">;; =&gt; [-1 -1.0]</span></span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>(m/- <span class="dv">1</span> <span class="dv">2</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; -8</span></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a>(m/- <span class="fl">1.0</span> <span class="fl">2.5</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; -8.5</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a>(<span class="kw">reduce</span> m/- [<span class="dv">1</span> <span class="dv">2</span> <span class="dv">3</span>]) <span class="co">;; =&gt; -4.0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="sourceClojure">
<div class="sourceCode" id="cb5"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>(m/long-sub <span class="dv">1</span>) <span class="co">;; =&gt; -1</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>(m/long-sub <span class="dv">1</span> <span class="dv">2</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; -8</span></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a>(m/long-sub <span class="fl">1.0</span> <span class="fl">2.5</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; -8</span></span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a>(<span class="kw">reduce</span> m/long-sub [<span class="dv">1</span> <span class="dv">2</span> <span class="fl">3.5</span>]) <span class="co">;; =&gt; -4</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>Multiplication</p>
<div class="sourceClojure">
<div class="sourceCode" id="cb6"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>(m/*) <span class="co">;; =&gt; 1.0</span></span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a>(m/* <span class="dv">1</span> <span class="dv">2</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; 24</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a>(m/* <span class="fl">1.0</span> <span class="fl">2.5</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; 30.0</span></span>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a>(<span class="kw">reduce</span> m/* [<span class="dv">1</span> <span class="dv">2</span> <span class="dv">3</span>]) <span class="co">;; =&gt; 6.0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="sourceClojure">
<div class="sourceCode" id="cb7"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>(m/long-mult) <span class="co">;; =&gt; 1</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>(m/long-mult <span class="dv">1</span> <span class="dv">2</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; 24</span></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a>(m/long-mult <span class="fl">1.0</span> <span class="fl">2.5</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; 24</span></span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a>(<span class="kw">reduce</span> m/long-mult [<span class="dv">1</span> <span class="dv">2</span> <span class="fl">3.5</span>]) <span class="co">;; =&gt; 6</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>Division</p>
<div class="sourceClojure">
<div class="sourceCode" id="cb8"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>[(m// <span class="dv">2</span>) (m// <span class="dv">2</span>) (<span class="kw">/</span> <span class="dv">2</span>)] <span class="co">;; =&gt; [0.5 0.5 1/2]</span></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a>(m// <span class="dv">1</span> <span class="dv">2</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; 0</span></span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a>(m// <span class="fl">1.0</span> <span class="fl">2.5</span> <span class="dv">3</span> <span class="dv">4</span>) <span class="co">;; =&gt; 0.03333333333333333</span></span>
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a>(<span class="kw">reduce</span> m// [<span class="dv">1</span> <span class="dv">2</span> <span class="dv">3</span>]) <span class="co">;; =&gt; 0.16666666666666666</span></span>
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a>(m/quot <span class="fl">10.5</span> -<span class="dv">3</span>) <span class="co">;; =&gt; -3.0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="sourceClojure">
<div class="sourceCode" id="cb9"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>(m/long-div <span class="dv">2</span>) <span class="co">;; =&gt; 0.5</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a>(m/long-div <span class="dv">100</span> <span class="dv">5</span> <span class="dv">3</span>) <span class="co">;; =&gt; 6</span></span>
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a>(m/long-div <span class="fl">100.5</span> <span class="fl">2.5</span> <span class="dv">3</span>) <span class="co">;; =&gt; 16</span></span>
<span id="cb9-4"><a href="#cb9-4" aria-hidden="true" tabindex="-1"></a>(<span class="kw">reduce</span> m/long-div [<span class="dv">100</span> <span class="dv">2</span> <span class="fl">3.5</span>]) <span class="co">;; =&gt; 16</span></span>
<span id="cb9-5"><a href="#cb9-5" aria-hidden="true" tabindex="-1"></a>(m/long-quot <span class="dv">10</span> -<span class="dv">3</span>) <span class="co">;; =&gt; -3</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>Increment and decrement</p>
<div class="sourceClojure">
<div class="sourceCode" id="cb10"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>(m/inc <span class="dv">4</span>) <span class="co">;; =&gt; 5</span></span>
<span id="cb10-2"><a href="#cb10-2" aria-hidden="true" tabindex="-1"></a>(m/inc <span class="fl">4.5</span>) <span class="co">;; =&gt; 5.5</span></span>
<span id="cb10-3"><a href="#cb10-3" aria-hidden="true" tabindex="-1"></a>(m/dec <span class="dv">4</span>) <span class="co">;; =&gt; 3</span></span>
<span id="cb10-4"><a href="#cb10-4" aria-hidden="true" tabindex="-1"></a>(m/dec <span class="fl">4.5</span>) <span class="co">;; =&gt; 3.5</span></span>
<span id="cb10-5"><a href="#cb10-5" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/inc [<span class="dv">1</span> <span class="dv">2</span> <span class="fl">3.5</span> <span class="fl">4.5</span>]) <span class="co">;; =&gt; (2.0 3.0 4.5 5.5)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="sourceClojure">
<div class="sourceCode" id="cb11"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>(m/long-inc <span class="dv">4</span>) <span class="co">;; =&gt; 5</span></span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a>(m/long-inc <span class="fl">4.5</span>) <span class="co">;; =&gt; 5</span></span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a>(m/long-dec <span class="dv">4</span>) <span class="co">;; =&gt; 3</span></span>
<span id="cb11-4"><a href="#cb11-4" aria-hidden="true" tabindex="-1"></a>(m/long-dec <span class="fl">4.5</span>) <span class="co">;; =&gt; 3</span></span>
<span id="cb11-5"><a href="#cb11-5" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/long-inc [<span class="dv">1</span> <span class="dv">2</span> <span class="fl">3.5</span> <span class="fl">4.5</span>]) <span class="co">;; =&gt; (2 3 4 5)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="remainders" class="level3">
<h3 class="anchored" data-anchor-id="remainders">Remainders</h3>
<ul>
<li><code>rem</code> and <code>mod</code> are the same as in <code>clojure.core</code>,</li>
<li><code>remainder</code> returns <span class="math inline">\(dividend - divisor * n\)</span>, where <span class="math inline">\(n\)</span> is the mathematical integer closest to <span class="math inline">\(\frac{dividend}{divisor}\)</span>. Returned value is inside the <span class="math inline">\([\frac{-|divisor|}{2},\frac{|divisor|}{2}]\)</span> range.</li>
<li><code>wrap</code> wraps the value to be within given interval (right open) <span class="math inline">\([a,b)\)</span> `</li>
</ul>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="core_files/0.png" class="clay-image img-fluid"></td>
<td><img src="core_files/1.png" class="clay-image img-fluid"></td>
</tr>
<tr class="even">
<td><img src="core_files/2.png" class="clay-image img-fluid"></td>
<td><img src="core_files/3.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb12"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a>(m/mod <span class="dv">10</span> <span class="dv">4</span>) <span class="co">;; =&gt; 2</span></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a>(m/mod -<span class="fl">10.25</span> <span class="fl">4.0</span>) <span class="co">;; =&gt; 1.75</span></span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a>(m/mod <span class="fl">10.25</span> -<span class="fl">4.0</span>) <span class="co">;; =&gt; -1.75</span></span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a>(m/mod -<span class="fl">10.25</span> -<span class="fl">4.0</span>) <span class="co">;; =&gt; -2.25</span></span>
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a>(m/rem <span class="dv">10</span> <span class="dv">4</span>) <span class="co">;; =&gt; 2</span></span>
<span id="cb12-6"><a href="#cb12-6" aria-hidden="true" tabindex="-1"></a>(m/rem -<span class="fl">10.25</span> <span class="fl">4.0</span>) <span class="co">;; =&gt; -2.25</span></span>
<span id="cb12-7"><a href="#cb12-7" aria-hidden="true" tabindex="-1"></a>(m/rem <span class="fl">10.25</span> -<span class="fl">4.0</span>) <span class="co">;; =&gt; 2.25</span></span>
<span id="cb12-8"><a href="#cb12-8" aria-hidden="true" tabindex="-1"></a>(m/rem -<span class="fl">10.25</span> -<span class="fl">4.0</span>) <span class="co">;; =&gt; -2.25</span></span>
<span id="cb12-9"><a href="#cb12-9" aria-hidden="true" tabindex="-1"></a>(m/remainder <span class="dv">10</span> <span class="dv">4</span>) <span class="co">;; =&gt; 2.0</span></span>
<span id="cb12-10"><a href="#cb12-10" aria-hidden="true" tabindex="-1"></a>(m/remainder -<span class="fl">10.25</span> <span class="fl">4.0</span>) <span class="co">;; =&gt; 1.75</span></span>
<span id="cb12-11"><a href="#cb12-11" aria-hidden="true" tabindex="-1"></a>(m/remainder <span class="fl">10.25</span> -<span class="fl">4.0</span>) <span class="co">;; =&gt; -1.75</span></span>
<span id="cb12-12"><a href="#cb12-12" aria-hidden="true" tabindex="-1"></a>(m/remainder -<span class="fl">10.25</span> -<span class="fl">4.0</span>) <span class="co">;; =&gt; 1.75</span></span>
<span id="cb12-13"><a href="#cb12-13" aria-hidden="true" tabindex="-1"></a>(m/wrap -<span class="fl">1.25</span> <span class="fl">1.25</span> <span class="fl">1.0</span>) <span class="co">;; =&gt; 1.0</span></span>
<span id="cb12-14"><a href="#cb12-14" aria-hidden="true" tabindex="-1"></a>(m/wrap -<span class="fl">1.25</span> <span class="fl">1.25</span> <span class="fl">1.35</span>) <span class="co">;; =&gt; -1.15</span></span>
<span id="cb12-15"><a href="#cb12-15" aria-hidden="true" tabindex="-1"></a>(m/wrap -<span class="fl">1.25</span> <span class="fl">1.25</span> -<span class="fl">1.25</span>) <span class="co">;; =&gt; -1.25</span></span>
<span id="cb12-16"><a href="#cb12-16" aria-hidden="true" tabindex="-1"></a>(m/wrap -<span class="fl">1.25</span> <span class="fl">1.25</span> <span class="fl">1.25</span>) <span class="co">;; =&gt; -1.25</span></span>
<span id="cb12-17"><a href="#cb12-17" aria-hidden="true" tabindex="-1"></a>(m/wrap [-<span class="fl">1.25</span> <span class="fl">1.25</span>] -<span class="fl">1.35</span>) <span class="co">;; =&gt; 1.15</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="min-max-abs" class="level3">
<h3 class="anchored" data-anchor-id="min-max-abs">Min, max, abs</h3>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb13"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a>(m/min <span class="dv">1</span> <span class="dv">2</span> -<span class="dv">3</span>) <span class="co">;; =&gt; -3</span></span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a>(m/min <span class="fl">1.0</span> <span class="dv">2</span> -<span class="dv">3</span>) <span class="co">;; =&gt; -3.0</span></span>
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a>(m/max <span class="dv">1</span> <span class="dv">2</span> -<span class="dv">3</span>) <span class="co">;; =&gt; 2</span></span>
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a>(m/max <span class="fl">1.0</span> <span class="dv">2</span> -<span class="dv">3</span>) <span class="co">;; =&gt; 2.0</span></span>
<span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a>(m/abs -<span class="dv">3</span>) <span class="co">;; =&gt; 3</span></span>
<span id="cb13-6"><a href="#cb13-6" aria-hidden="true" tabindex="-1"></a>(m/long-abs -<span class="dv">3</span>) <span class="co">;; =&gt; 3</span></span>
<span id="cb13-7"><a href="#cb13-7" aria-hidden="true" tabindex="-1"></a>(m/abs -<span class="fl">3.5</span>) <span class="co">;; =&gt; 3.5</span></span>
<span id="cb13-8"><a href="#cb13-8" aria-hidden="true" tabindex="-1"></a>(m/long-abs -<span class="fl">3.5</span>) <span class="co">;; =&gt; 3</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
<section id="smooth-maximum" class="level4">
<h4 class="anchored" data-anchor-id="smooth-maximum">Smooth maximum</h4>
<p>Smooth maximum is a family of functions <span class="math inline">\(\max_\alpha(xs)\)</span> for which <span class="math inline">\(\lim_{\alpha\to\infty}\max_\alpha(xs)=\max(xs)\)</span>.</p>
<p>Five types of smooth maximum are defined (see <a href="https://en.wikipedia.org/wiki/Smooth_maximum">wikipedia</a> for formulas):</p>
<ul>
<li><code>:lse</code> - LogSumExp (default)</li>
<li><code>:boltzmann</code> - Boltzmann operator, works for small alpha values</li>
<li><code>:mellowmax</code></li>
<li><code>:p-norm</code></li>
<li><code>:smu</code> - smooth maximum unit, <span class="math inline">\(\epsilon=\frac{1}{\alpha}\)</span></li>
</ul>
<p><code>:lse</code>, <code>:boltzmann</code> and <code>:mellowmax</code> are also smooth minimum for negative <span class="math inline">\(\alpha\)</span> values.</p>
<p>The following plots show value of the smooth max for different <span class="math inline">\(\alpha\)</span> and set of the numbers equal to <code>[-3.5 -2 -1 0.1 3 4]</code>. Blue dashed horizontal lines are minimum (-3.5) and maximum values (4.0).</p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="core_files/4.png" class="clay-image img-fluid"></td>
<td><img src="core_files/5.png" class="clay-image img-fluid"></td>
</tr>
<tr class="even">
<td><img src="core_files/6.png" class="clay-image img-fluid"></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<p>The following plots are defined only for positive <span class="math inline">\(\alpha\)</span>.</p>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="core_files/7.png" class="clay-image img-fluid"></td>
<td><img src="core_files/8.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb14"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a>(m/smooth-max [-<span class="fl">3.5</span> -<span class="dv">2</span> -<span class="dv">1</span> <span class="fl">0.1</span> <span class="dv">3</span> <span class="dv">4</span>] <span class="fl">4.0</span> <span class="at">:lse</span>) <span class="co">;; =&gt; 4.004537523710555</span></span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a>(m/smooth-max [-<span class="fl">3.5</span> -<span class="dv">2</span> -<span class="dv">1</span> <span class="fl">0.1</span> <span class="dv">3</span> <span class="dv">4</span>] -<span class="fl">4.0</span> <span class="at">:lse</span>) <span class="co">;; =&gt; -3.500630381944282</span></span>
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a>(m/smooth-max [-<span class="fl">3.5</span> -<span class="dv">2</span> -<span class="dv">1</span> <span class="fl">0.1</span> <span class="dv">3</span> <span class="dv">4</span>] <span class="fl">4.0</span> <span class="at">:boltzmann</span>) <span class="co">;; =&gt; 3.9820131397304284</span></span>
<span id="cb14-4"><a href="#cb14-4" aria-hidden="true" tabindex="-1"></a>(m/smooth-max [-<span class="fl">3.5</span> -<span class="dv">2</span> -<span class="dv">1</span> <span class="fl">0.1</span> <span class="dv">3</span> <span class="dv">4</span>] -<span class="fl">4.0</span> <span class="at">:boltzmann</span>) <span class="co">;; =&gt; -3.496176019710726</span></span>
<span id="cb14-5"><a href="#cb14-5" aria-hidden="true" tabindex="-1"></a>(m/smooth-max [-<span class="fl">3.5</span> -<span class="dv">2</span> -<span class="dv">1</span> <span class="fl">0.1</span> <span class="dv">3</span> <span class="dv">4</span>] <span class="fl">4.0</span> <span class="at">:mellowmax</span>) <span class="co">;; =&gt; 3.5565976564035413</span></span>
<span id="cb14-6"><a href="#cb14-6" aria-hidden="true" tabindex="-1"></a>(m/smooth-max [-<span class="fl">3.5</span> -<span class="dv">2</span> -<span class="dv">1</span> <span class="fl">0.1</span> <span class="dv">3</span> <span class="dv">4</span>] -<span class="fl">4.0</span> <span class="at">:mellowmax</span>) <span class="co">;; =&gt; -3.0526905146372685</span></span>
<span id="cb14-7"><a href="#cb14-7" aria-hidden="true" tabindex="-1"></a>(m/smooth-max [-<span class="fl">3.5</span> -<span class="dv">2</span> -<span class="dv">1</span> <span class="fl">0.1</span> <span class="dv">3</span> <span class="dv">4</span>] <span class="fl">4.0</span> <span class="at">:p-norm</span>) <span class="co">;; =&gt; 4.738284340366858</span></span>
<span id="cb14-8"><a href="#cb14-8" aria-hidden="true" tabindex="-1"></a>(m/smooth-max [-<span class="fl">3.5</span> -<span class="dv">2</span> -<span class="dv">1</span> <span class="fl">0.1</span> <span class="dv">3</span> <span class="dv">4</span>] <span class="fl">4.0</span> <span class="at">:smu</span>) <span class="co">;; =&gt; 4.060190281957045</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
</section>
<section id="fma" class="level3">
<h3 class="anchored" data-anchor-id="fma">fma</h3>
<p>Fused multiply-add <span class="math inline">\(fma(a,b,c)=a+b*c\)</span> is the operation implemented with better accuracy in Java 9+ and as one instruction (see more <a href="https://en.wikipedia.org/wiki/Multiply%E2%80%93accumulate_operation#Fused_multiply%E2%80%93add">here</a> and <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Math.html#fma-double-double-double-">here</a>). When Java 8 is used <code>fma</code> is replaced with direct <code>a+b*c</code> formula.</p>
<div class="callout callout-style-default callout-tip callout-titled" title="Defined functions">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Defined functions
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><code>fma</code>, <code>muladd</code>, <code>negmuladd</code></li>
<li><code>difference-of-products</code>, <code>sum-of-products</code></li>
</ul>
</div>
</div>
<p><span class="math display">\[\operatorname{fma}(a,b,c)=\operatorname{muladd}(a,b,c)=a+bc\]</span> <span class="math display">\[\operatorname{negmuladd}(a,b,c)=\operatorname{fma}(-a,b,c)\]</span></p>
<p><code>difference-of-products</code> (dop) and <code>sum-of-products</code> (sop) are using Kahan’s algorithm to avoid <a href="https://en.wikipedia.org/wiki/Catastrophic_cancellation">catastrophic cancellation</a>.</p>
<p><span class="math display">\[\operatorname{dop}(a,b,c,d)=ab-cd=\operatorname{fma}(a,b,-cd)+\operatorname{fma}(-c,d,cd)\]</span> <span class="math display">\[\operatorname{sop}(a,b,c,d)=ab+cd=\operatorname{fma}(a,b,cd)+\operatorname{fma}(c,d,-cd)\]</span></p>
<p>The following example shows that <span class="math inline">\(x^2-y^2\)</span> differs from the best floating point approximation which is equal <code>1.8626451518330422e-9</code>.</p>
<div class="sourceClojure">
<div class="sourceCode" id="cb15"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a>(<span class="kw">let</span> [x (m/inc (m/pow <span class="dv">2</span> -<span class="dv">29</span>))</span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a>      y (m/inc (m/pow <span class="dv">2</span> -<span class="dv">30</span>))]</span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a>  {<span class="at">:proper-value</span> (m/difference-of-products x x y y)</span>
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a>   <span class="at">:wrong-value</span> (m/- (m/* x x) (m/* y y))})</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="printedClojure">
<div class="sourceCode" id="cb16"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a>{<span class="at">:proper-value</span> <span class="fl">1.8626451518330422E-9</span>, <span class="at">:wrong-value</span> <span class="fl">1.862645149230957E-9</span>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb17"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a>(m/fma <span class="dv">3</span> <span class="dv">4</span> <span class="dv">5</span>) <span class="co">;; =&gt; 17.0</span></span>
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a>(m/muladd <span class="dv">3</span> <span class="dv">4</span> <span class="dv">5</span>) <span class="co">;; =&gt; 17.0</span></span>
<span id="cb17-3"><a href="#cb17-3" aria-hidden="true" tabindex="-1"></a>(m/negmuladd <span class="dv">3</span> <span class="dv">4</span> <span class="dv">5</span>) <span class="co">;; =&gt; -7.0</span></span>
<span id="cb17-4"><a href="#cb17-4" aria-hidden="true" tabindex="-1"></a>(m/difference-of-products <span class="dv">3</span> <span class="dv">3</span> <span class="dv">4</span> <span class="dv">4</span>) <span class="co">;; =&gt; -7.0</span></span>
<span id="cb17-5"><a href="#cb17-5" aria-hidden="true" tabindex="-1"></a>(m/sum-of-products <span class="dv">3</span> <span class="dv">3</span> <span class="dv">4</span> <span class="dv">4</span>) <span class="co">;; =&gt; 25.0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
</section>
<section id="rounding" class="level2">
<h2 class="anchored" data-anchor-id="rounding">Rounding</h2>
<p>Various rounding functions.</p>
<ul>
<li><code>floor</code>, <code>ceil</code> and <code>rint</code> accept additional argument, <code>scale</code>, which allows to round to the nearest multiple of scale.</li>
<li><code>round</code> returns <code>long</code> while <code>rint</code> returns <code>double</code></li>
<li><code>approx</code> rounds number to the given number of digits, uses <code>bigdec</code></li>
<li><code>trunc</code> returns integer part of a number, <code>frac</code> returns fractional part</li>
<li><code>trunc</code> returns <code>double</code> while <code>itrunc</code> returns long</li>
<li><code>sfrac</code> keeps sign of the argument</li>
<li><code>qfloor</code>, <code>qceil</code> and <code>qround</code> are implemented using casting to <code>long</code></li>
</ul>
<div class="callout callout-style-default callout-tip callout-titled" title="Defined functions">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Defined functions
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><code>floor</code>, <code>ceil</code></li>
<li><code>round</code>, <code>round-even</code>, <code>rint</code>, <code>approx</code>, <code>trunc</code>, <code>itrunc</code></li>
<li><code>qfloor</code>, <code>qceil</code>, <code>qround</code></li>
<li><code>frac</code>, <code>sfrac</code></li>
<li><code>round-up-pow2</code></li>
</ul>
</div>
</div>
<div class="clay-table">
<div>
<div class="table-responsive">
<table class="table table-hover clay-table" data-quarto-postprocess="true">
<tbody>
<tr class="odd">
<td><img src="core_files/9.png" class="clay-image img-fluid"></td>
<td><img src="core_files/10.png" class="clay-image img-fluid"></td>
</tr>
<tr class="even">
<td><img src="core_files/11.png" class="clay-image img-fluid"></td>
<td><img src="core_files/12.png" class="clay-image img-fluid"></td>
</tr>
<tr class="odd">
<td><img src="core_files/13.png" class="clay-image img-fluid"></td>
<td><img src="core_files/14.png" class="clay-image img-fluid"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb18"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/floor [-<span class="fl">10.5</span> <span class="fl">10.5</span>]) <span class="co">;; =&gt; (-11.0 10.0)</span></span>
<span id="cb18-2"><a href="#cb18-2" aria-hidden="true" tabindex="-1"></a>(m/floor <span class="fl">10.5</span> <span class="fl">4.0</span>) <span class="co">;; =&gt; 8.0</span></span>
<span id="cb18-3"><a href="#cb18-3" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/ceil [-<span class="fl">10.5</span> <span class="fl">10.5</span>]) <span class="co">;; =&gt; (-10.0 11.0)</span></span>
<span id="cb18-4"><a href="#cb18-4" aria-hidden="true" tabindex="-1"></a>(m/ceil <span class="fl">10.5</span> <span class="fl">4.0</span>) <span class="co">;; =&gt; 12.0</span></span>
<span id="cb18-5"><a href="#cb18-5" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/rint [-<span class="fl">10.51</span> -<span class="fl">10.5</span> -<span class="fl">10.49</span> <span class="fl">10.49</span> <span class="fl">10.5</span> <span class="fl">10.51</span>]) <span class="co">;; =&gt; (-11.0 -10.0 -10.0 10.0 10.0 11.0)</span></span>
<span id="cb18-6"><a href="#cb18-6" aria-hidden="true" tabindex="-1"></a>(m/rint <span class="fl">10.5</span> <span class="fl">4.0</span>) <span class="co">;; =&gt; 12.0</span></span>
<span id="cb18-7"><a href="#cb18-7" aria-hidden="true" tabindex="-1"></a>(m/rint <span class="fl">10.591</span> <span class="fl">0.1</span>) <span class="co">;; =&gt; 10.600000000000001</span></span>
<span id="cb18-8"><a href="#cb18-8" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/round [-<span class="fl">10.51</span> -<span class="fl">10.5</span> -<span class="fl">10.49</span> <span class="fl">10.49</span> <span class="fl">10.5</span> <span class="fl">10.51</span>]) <span class="co">;; =&gt; (-11 -10 -10 10 11 11)</span></span>
<span id="cb18-9"><a href="#cb18-9" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/round-even [-<span class="fl">10.51</span> -<span class="fl">10.5</span> -<span class="fl">10.49</span> <span class="fl">10.49</span> <span class="fl">10.5</span> <span class="fl">10.51</span>]) <span class="co">;; =&gt; (-11 -10 -10 10 10 11)</span></span>
<span id="cb18-10"><a href="#cb18-10" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/qfloor [-<span class="fl">10.5</span> <span class="fl">10.5</span>]) <span class="co">;; =&gt; (-11 10)</span></span>
<span id="cb18-11"><a href="#cb18-11" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/qceil [-<span class="fl">10.5</span> <span class="fl">10.5</span>]) <span class="co">;; =&gt; (-10 11)</span></span>
<span id="cb18-12"><a href="#cb18-12" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/qround [-<span class="fl">10.51</span> -<span class="fl">10.5</span> -<span class="fl">10.49</span> <span class="fl">10.49</span> <span class="fl">10.5</span> <span class="fl">10.51</span>]) <span class="co">;; =&gt; (-11 -11 -10 10 11 11)</span></span>
<span id="cb18-13"><a href="#cb18-13" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/trunc [-<span class="fl">10.591</span> <span class="fl">10.591</span>]) <span class="co">;; =&gt; (-10.0 10.0)</span></span>
<span id="cb18-14"><a href="#cb18-14" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/itrunc [-<span class="fl">10.591</span> <span class="fl">10.591</span>]) <span class="co">;; =&gt; (-10 10)</span></span>
<span id="cb18-15"><a href="#cb18-15" aria-hidden="true" tabindex="-1"></a>(m/approx <span class="fl">10.591</span>) <span class="co">;; =&gt; 10.59</span></span>
<span id="cb18-16"><a href="#cb18-16" aria-hidden="true" tabindex="-1"></a>(m/approx <span class="fl">10.591</span> <span class="dv">1</span>) <span class="co">;; =&gt; 10.6</span></span>
<span id="cb18-17"><a href="#cb18-17" aria-hidden="true" tabindex="-1"></a>(m/approx <span class="fl">10.591</span> <span class="dv">0</span>) <span class="co">;; =&gt; 11.0</span></span>
<span id="cb18-18"><a href="#cb18-18" aria-hidden="true" tabindex="-1"></a>(m/approx -<span class="fl">10.591</span>) <span class="co">;; =&gt; -10.59</span></span>
<span id="cb18-19"><a href="#cb18-19" aria-hidden="true" tabindex="-1"></a>(m/approx -<span class="fl">10.591</span> <span class="dv">1</span>) <span class="co">;; =&gt; -10.6</span></span>
<span id="cb18-20"><a href="#cb18-20" aria-hidden="true" tabindex="-1"></a>(m/approx -<span class="fl">10.591</span> <span class="dv">0</span>) <span class="co">;; =&gt; -11.0</span></span>
<span id="cb18-21"><a href="#cb18-21" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/frac [-<span class="fl">10.591</span> <span class="fl">10.591</span>]) <span class="co">;; =&gt; (0.5909999999999993 0.5909999999999993)</span></span>
<span id="cb18-22"><a href="#cb18-22" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/sfrac [-<span class="fl">10.591</span> <span class="fl">10.591</span>]) <span class="co">;; =&gt; (-0.5909999999999993 0.5909999999999993)</span></span>
<span id="cb18-23"><a href="#cb18-23" aria-hidden="true" tabindex="-1"></a>(<span class="kw">map</span> m/round-up-pow2 (<span class="kw">range</span> <span class="dv">10</span>)) <span class="co">;; =&gt; (0 1 2 4 4 8 8 8 8 16)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>The difference between <code>rint</code> and <code>round</code>. <code>round</code> is bounded by minimum and maximum <code>long</code> values.</p>
<div class="sourceClojure">
<div class="sourceCode" id="cb19"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a>(m/rint <span class="fl">1.23456789E30</span>) <span class="co">;; =&gt; 1.23456789E30</span></span>
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a>(m/round <span class="fl">1.23456789E30</span>) <span class="co">;; =&gt; 9223372036854775807</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="sign" class="level2">
<h2 class="anchored" data-anchor-id="sign">Sign</h2>
<p>Sign of the number.</p>
<div class="callout callout-style-default callout-tip callout-titled" title="Defined functions">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Defined functions
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><code>signum</code> and <code>sgn</code></li>
<li><code>copy-sign</code></li>
</ul>
</div>
</div>
<p><span class="math display">\[\operatorname{signum}(x)=\begin{cases}
-1 &amp; x&lt;0 \\
1 &amp; x&gt;0 \\
0 &amp; x=0
\end{cases}\]</span></p>
<p><span class="math display">\[\operatorname{sgn}(x)=\begin{cases}
-1 &amp; x&lt;0 \\
1 &amp; x\geq 0
\end{cases}\]</span></p>
<p><code>copy-sign</code> sets the sign of the second argument to the first. Please note that <code>-0.0</code> is negative and <code>0.0</code> is positive.</p>
<p><span class="math display">\[\operatorname{copy-sign}(x,y)=\begin{cases}
|x| &amp; y&gt;0 \lor y=0.0\\
-|x| &amp; y&lt;0 \lor y=-0.0
\end{cases}\]</span></p>
<div class="callout callout-style-default callout-note callout-titled" title="Examples">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Examples
</div>
</div>
<div class="callout-body-container callout-body">
<div class="sourceClojure">
<div class="sourceCode" id="cb20"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a>(m/signum -<span class="fl">2.5</span>) <span class="co">;; =&gt; -1.0</span></span>
<span id="cb20-2"><a href="#cb20-2" aria-hidden="true" tabindex="-1"></a>(m/signum <span class="fl">2.5</span>) <span class="co">;; =&gt; 1.0</span></span>
<span id="cb20-3"><a href="#cb20-3" aria-hidden="true" tabindex="-1"></a>(m/sgn -<span class="fl">2.5</span>) <span class="co">;; =&gt; -1.0</span></span>
<span id="cb20-4"><a href="#cb20-4" aria-hidden="true" tabindex="-1"></a>(m/sgn <span class="fl">2.5</span>) <span class="co">;; =&gt; 1.0</span></span>
<span id="cb20-5"><a href="#cb20-5" aria-hidden="true" tabindex="-1"></a>(m/signum <span class="dv">0</span>) <span class="co">;; =&gt; 0.0</span></span>
<span id="cb20-6"><a href="#cb20-6" aria-hidden="true" tabindex="-1"></a>(m/sgn <span class="dv">0</span>) <span class="co">;; =&gt; 1.0</span></span>
<span id="cb20-7"><a href="#cb20-7" aria-hidden="true" tabindex="-1"></a>(m/copy-sign <span class="dv">123</span> -<span class="dv">10</span>) <span class="co">;; =&gt; -123.0</span></span>
<span id="cb20-8"><a href="#cb20-8" aria-hidden="true" tabindex="-1"></a>(m/copy-sign -<span class="dv">123</span> <span class="dv">10</span>) <span class="co">;; =&gt; 123.0</span></span>
<span id="cb20-9"><a href="#cb20-9" aria-hidden="true" tabindex="-1"></a>(m/copy-sign <span class="dv">123</span> -<span class="fl">0.0</span>) <span class="co">;; =&gt; -123.0</span></span>
<span id="cb20-10"><a href="#cb20-10" aria-hidden="true" tabindex="-1"></a>(m/copy-sign -<span class="dv">123</span> <span class="fl">0.0</span>) <span class="co">;; =&gt; 123.0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</div>
</div>
</section>
<section id="predicates" class="level2">
<h2 class="anchored" data-anchor-id="predicates">Predicates</h2>
</section>
<section id="trigonometry" class="level2">
<h2 class="anchored" data-anchor-id="trigonometry">Trigonometry</h2>
</section>
<section id="power-and-logarithms" class="level2">
<h2 class="anchored" data-anchor-id="power-and-logarithms">Power and logarithms</h2>
</section>
<section id="bitwise-operations" class="level2">
<h2 class="anchored" data-anchor-id="bitwise-operations">Bitwise operations</h2>
</section>
<section id="floating-point" class="level2">
<h2 class="anchored" data-anchor-id="floating-point">Floating point</h2>
</section>
<section id="other" class="level2">
<h2 class="anchored" data-anchor-id="other">Other</h2>
<section id="gcd-and-lcm" class="level3">
<h3 class="anchored" data-anchor-id="gcd-and-lcm">GCD and LCM</h3>
</section>
<section id="combinatorics" class="level3">
<h3 class="anchored" data-anchor-id="combinatorics">Combinatorics</h3>
</section>
<section id="rank-and-order" class="level3">
<h3 class="anchored" data-anchor-id="rank-and-order">Rank and order</h3>
</section>
<section id="sampling" class="level3">
<h3 class="anchored" data-anchor-id="sampling">Sampling</h3>
</section>
<section id="interpolation-and-mapping" class="level3">
<h3 class="anchored" data-anchor-id="interpolation-and-mapping">Interpolation and mapping</h3>
</section>
</section>
<section id="constants" class="level2">
<h2 class="anchored" data-anchor-id="constants">Constants</h2>
</section>
<section id="reference" class="level2">
<h2 class="anchored" data-anchor-id="reference">Reference</h2>
<section id="fastmath.core" class="level3">
<h3 class="anchored" data-anchor-id="fastmath.core">fastmath.core</h3>
<p>Collection of basic math functions and constants.</p>
<p>Contains:</p>
<ul>
<li>Basic math functions</li>
<li>Predicates</li>
<li>Bitwise operations</li>
<li>Trigonometry</li>
<li>Log/power</li>
<li>Floating point format operations</li>
<li>Factorial, combinations, gcd/lcd</li>
<li>Additional functions: sampling, rank, lerp</li>
</ul>
<p>Almost all math functions are backed by <a href="https://github.com/jeffhain/jafama">FastMath</a> library. Almost all operates on primitive <code>double</code> and returns <code>double</code> or <code>long</code> and are inlined.</p>
<p>#### Primitive math operators</p>
<p>Inlined function operating on double/longs as a replacement of Clojure numerical tower: <code>*</code> <code>+</code> <code>-</code> <code>/</code> <code>&gt;</code> <code>&lt;</code> <code>&gt;=</code> <code>&lt;=</code> <code>==</code> <code>rem</code> <code>quot</code> <code>mod</code> <code>bit-or</code> <code>bit-and</code> <code>bit-xor</code> <code>bit-and-not</code> <code>bit-set</code> <code>bit-clear</code> <code>bit-test</code> <code>bit-flip</code> <code>bit-not</code> <code>bit-shift-left</code> <code>bit-shift-right</code> <code>unsigned-bit-shift-right</code> <code>inc</code> <code>dec</code> <code>zero?</code> <code>neg?</code> <code>pos?</code> <code>min</code> <code>max</code> <code>even?</code> <code>odd?</code> <code>abs</code></p>
<p>And additionally:</p>
<ul>
<li><code>&lt;&lt;</code> - bit shift left</li>
<li><code>&gt;&gt;</code> - signed bit shift right</li>
<li><code>&gt;&gt;&gt;</code> - unsigned bit shift right</li>
<li><code>not==</code> - not equal</li>
</ul>
<p>To turn on primitive math on your namespace call <a href="#LOS-use-primitive-operators">use-primitive-operators</a>. To turn off and revert original versions call <a href="#LOS-unuse-primitive-operators">unuse-primitive-operators</a> which is recomended when Clojure 1.12+ is used.</p>
<span id="#LOS-*"></span>
<section id="section" class="level4">
<h4 class="anchored" data-anchor-id="section">*</h4>
<ul>
<li><code>(*)</code></li>
<li><code>(* a)</code></li>
<li><code>(* a b)</code></li>
<li><code>(* a b c)</code></li>
<li><code>(* a b c d)</code></li>
<li><code>(* a b c d &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>*</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L128">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-+"></span>
</section>
<section id="section-1" class="level4">
<h4 class="anchored" data-anchor-id="section-1">+</h4>
<ul>
<li><code>(+)</code></li>
<li><code>(+ a)</code></li>
<li><code>(+ a b)</code></li>
<li><code>(+ a b c)</code></li>
<li><code>(+ a b c d)</code></li>
<li><code>(+ a b c d &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>+</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L82">source</a></small><hr style="margin: 0"></div>
<span id="#LOS--"></span>
</section>
<section id="section-2" class="level4">
<h4 class="anchored" data-anchor-id="section-2">-</h4>
<ul>
<li><code>(- a)</code></li>
<li><code>(- a b)</code></li>
<li><code>(- a b c)</code></li>
<li><code>(- a b c d)</code></li>
<li><code>(- a b c d &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>-</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L106">source</a></small><hr style="margin: 0"></div>
<span id="#LOS--E"></span>
</section>
<section id="e-const" class="level4">
<h4 class="anchored" data-anchor-id="e-const">-E <sup><sub>CONST</sub></sup></h4>
<p><code>-E = -2.718281828459045</code></p>
<p>Value of <span class="math inline">\(-e\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L655">source</a></small><hr style="margin: 0"></div>
<span id="#LOS--HALF_PI"></span>
</section>
<section id="half_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="half_pi-const">-HALF_PI <sup><sub>CONST</sub></sup></h4>
<p><code>-HALF_PI = -1.5707963267948966</code></p>
<p>Value of <span class="math inline">\(-\frac{\pi}{2}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L650">source</a></small><hr style="margin: 0"></div>
<span id="#LOS--PI"></span>
</section>
<section id="pi-const" class="level4">
<h4 class="anchored" data-anchor-id="pi-const">-PI <sup><sub>CONST</sub></sup></h4>
<p><code>-PI = -3.141592653589793</code></p>
<p>Value of <span class="math inline">\(-\pi\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L649">source</a></small><hr style="margin: 0"></div>
<span id="#LOS--QUARTER_PI"></span>
</section>
<section id="quarter_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="quarter_pi-const">-QUARTER_PI <sup><sub>CONST</sub></sup></h4>
<p><code>-QUARTER_PI = -0.7853981633974483</code></p>
<p>Value of <span class="math inline">\(-\frac{\pi}{4}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L652">source</a></small><hr style="margin: 0"></div>
<span id="#LOS--TAU"></span>
</section>
<section id="tau-const" class="level4">
<h4 class="anchored" data-anchor-id="tau-const">-TAU <sup><sub>CONST</sub></sup></h4>
<p><code>-TAU = -6.283185307179586</code></p>
<p>Alias for <a href="#LOS-TWO_PI-">TWO_PI-</a></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L654">source</a></small><hr style="margin: 0"></div>
<span id="#LOS--THIRD_PI"></span>
</section>
<section id="third_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="third_pi-const">-THIRD_PI <sup><sub>CONST</sub></sup></h4>
<p><code>-THIRD_PI = 1.0471975511965976</code></p>
<p>Value of <span class="math inline">\(-\frac{\pi}{3}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L651">source</a></small><hr style="margin: 0"></div>
<span id="#LOS--TWO_PI"></span>
</section>
<section id="two_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="two_pi-const">-TWO_PI <sup><sub>CONST</sub></sup></h4>
<p><code>-TWO_PI = -6.283185307179586</code></p>
<p>Value of <span class="math inline">\(-2 {\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L653">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-/"></span>
</section>
<section id="section-3" class="level4">
<h4 class="anchored" data-anchor-id="section-3">/</h4>
<ul>
<li><code>(/ a)</code></li>
<li><code>(/ a b)</code></li>
<li><code>(/ a b c)</code></li>
<li><code>(/ a b c d)</code></li>
<li><code>(/ a b c d &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>/</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L152">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-<"></span>
</section>
<section id="section-4" class="level4">
<h4 class="anchored" data-anchor-id="section-4">&lt;</h4>
<ul>
<li><code>(&lt; _)</code></li>
<li><code>(&lt; a b)</code></li>
<li><code>(&lt; a b &amp; r)</code></li>
</ul>
<p>Primitive math less-then function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L357">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-<<"></span>
</section>
<section id="section-5" class="level4">
<h4 class="anchored" data-anchor-id="section-5">&lt;&lt;</h4>
<ul>
<li><code>(&lt;&lt; x shift)</code></li>
</ul>
<p>Shift bits left</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L512">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-<="></span>
</section>
<section id="section-6" class="level4">
<h4 class="anchored" data-anchor-id="section-6">&lt;=</h4>
<ul>
<li><code>(&lt;= _)</code></li>
<li><code>(&lt;= a b)</code></li>
<li><code>(&lt;= a b &amp; r)</code></li>
</ul>
<p>Primitive math less-and-equal function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L379">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-=="></span>
</section>
<section id="section-7" class="level4">
<h4 class="anchored" data-anchor-id="section-7">==</h4>
<ul>
<li><code>(== _)</code></li>
<li><code>(== a b)</code></li>
<li><code>(== a b &amp; r)</code></li>
</ul>
<p>Primitive math equality function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L336">source</a></small><hr style="margin: 0"></div>
<span id="#LOS->"></span>
</section>
<section id="section-8" class="level4">
<h4 class="anchored" data-anchor-id="section-8">&gt;</h4>
<ul>
<li><code>(&gt; _)</code></li>
<li><code>(&gt; a b)</code></li>
<li><code>(&gt; a b &amp; r)</code></li>
</ul>
<p>Primitive math greater-than function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L368">source</a></small><hr style="margin: 0"></div>
<span id="#LOS->="></span>
</section>
<section id="section-9" class="level4">
<h4 class="anchored" data-anchor-id="section-9">&gt;=</h4>
<ul>
<li><code>(&gt;= _)</code></li>
<li><code>(&gt;= a b)</code></li>
<li><code>(&gt;= a b &amp; r)</code></li>
</ul>
<p>Primitive math greater-and-equal function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L390">source</a></small><hr style="margin: 0"></div>
<span id="#LOS->>"></span>
</section>
<section id="section-10" class="level4">
<h4 class="anchored" data-anchor-id="section-10">&gt;&gt;</h4>
<ul>
<li><code>(&gt;&gt; x shift)</code></li>
</ul>
<p>Shift bits right and keep most significant bit unchanged</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L524">source</a></small><hr style="margin: 0"></div>
<span id="#LOS->>>"></span>
</section>
<section id="section-11" class="level4">
<h4 class="anchored" data-anchor-id="section-11">&gt;&gt;&gt;</h4>
<ul>
<li><code>(&gt;&gt;&gt; x shift)</code></li>
</ul>
<p>Shift bits right and set most significant bit to <code>0</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L536">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-CATALAN_G"></span>
</section>
<section id="catalan_g-const" class="level4">
<h4 class="anchored" data-anchor-id="catalan_g-const">CATALAN_G <sup><sub>CONST</sub></sup></h4>
<p><code>CATALAN_G = 0.915965594177219</code></p>
<p>Catalan G</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L664">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-E"></span>
</section>
<section id="e-const-1" class="level4">
<h4 class="anchored" data-anchor-id="e-const-1">E <sup><sub>CONST</sub></sup></h4>
<p><code>E = 2.718281828459045</code></p>
<p>Value of <span class="math inline">\(e\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L648">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-EPSILON"></span>
</section>
<section id="epsilon-const" class="level4">
<h4 class="anchored" data-anchor-id="epsilon-const">EPSILON <sup><sub>CONST</sub></sup></h4>
<p><code>EPSILON = 1.0E-10</code></p>
<p>Very small number <span class="math inline">\(\varepsilon\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L661">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-FOUR_INV_PI"></span>
</section>
<section id="four_inv_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="four_inv_pi-const">FOUR_INV_PI <sup><sub>CONST</sub></sup></h4>
<p><code>FOUR_INV_PI = 1.2732395447351628</code></p>
<p>Value of <span class="math inline">\(\frac{4}{\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L658">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-GAMMA"></span>
</section>
<section id="gamma-const" class="level4">
<h4 class="anchored" data-anchor-id="gamma-const">GAMMA <sup><sub>CONST</sub></sup></h4>
<p><code>GAMMA = 0.5772156649015329</code></p>
<p>Euler-Mascheroni constant</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L662">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-HALF_PI"></span>
</section>
<section id="half_pi-const-1" class="level4">
<h4 class="anchored" data-anchor-id="half_pi-const-1">HALF_PI <sup><sub>CONST</sub></sup></h4>
<p><code>HALF_PI = 1.5707963267948966</code></p>
<p>Value of <span class="math inline">\(\frac{\pi}{2}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L643">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-INV_FOUR_PI"></span>
</section>
<section id="inv_four_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="inv_four_pi-const">INV_FOUR_PI <sup><sub>CONST</sub></sup></h4>
<p><code>INV_FOUR_PI = 0.07957747154594767</code></p>
<p>Value of <span class="math inline">\(\frac{1}{4 \pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L660">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-INV_LN2"></span>
</section>
<section id="inv_ln2-const" class="level4">
<h4 class="anchored" data-anchor-id="inv_ln2-const">INV_LN2 <sup><sub>CONST</sub></sup></h4>
<p><code>INV_LN2 = 1.4426950408889634</code></p>
<p><span class="math inline">\(\frac{1}{\ln{2}}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1073">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-INV_LOG_HALF"></span>
</section>
<section id="inv_log_half-const" class="level4">
<h4 class="anchored" data-anchor-id="inv_log_half-const">INV_LOG_HALF <sup><sub>CONST</sub></sup></h4>
<p><code>INV_LOG_HALF = -1.4426950408889634</code></p>
<p><span class="math inline">\(\frac{1}{\ln{0.5}}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1076">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-INV_PI"></span>
</section>
<section id="inv_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="inv_pi-const">INV_PI <sup><sub>CONST</sub></sup></h4>
<p><code>INV_PI = 0.3183098861837907</code></p>
<p>Value of <span class="math inline">\(\frac{1}{\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L656">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-INV_SQRT2PI"></span>
</section>
<section id="inv_sqrt2pi-const" class="level4">
<h4 class="anchored" data-anchor-id="inv_sqrt2pi-const">INV_SQRT2PI <sup><sub>CONST</sub></sup></h4>
<p><code>INV_SQRT2PI = 0.3989422804014327</code></p>
<p><span class="math inline">\(\frac{1}{\sqrt{2\pi}}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1829">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-INV_SQRTPI"></span>
</section>
<section id="inv_sqrtpi-const" class="level4">
<h4 class="anchored" data-anchor-id="inv_sqrtpi-const">INV_SQRTPI <sup><sub>CONST</sub></sup></h4>
<p><code>INV_SQRTPI = 0.5641895835477563</code></p>
<p><span class="math inline">\(\frac{1}{\sqrt\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1830">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-INV_SQRT_2"></span>
</section>
<section id="inv_sqrt_2-const" class="level4">
<h4 class="anchored" data-anchor-id="inv_sqrt_2-const">INV_SQRT_2 <sup><sub>CONST</sub></sup></h4>
<p><code>INV_SQRT_2 = 0.7071067811865475</code></p>
<p><span class="math inline">\(\frac{1}{\sqrt{2}}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1834">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-INV_TWO_PI"></span>
</section>
<section id="inv_two_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="inv_two_pi-const">INV_TWO_PI <sup><sub>CONST</sub></sup></h4>
<p><code>INV_TWO_PI = 0.15915494309189535</code></p>
<p>Value of <span class="math inline">\(\frac{1}{2 \pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L659">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-LANCZOS_G"></span>
</section>
<section id="lanczos_g-const" class="level4">
<h4 class="anchored" data-anchor-id="lanczos_g-const">LANCZOS_G <sup><sub>CONST</sub></sup></h4>
<p><code>LANCZOS_G = 4.7421875</code></p>
<p>Lanchos approximation <code>g</code> constant</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L663">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-LN10"></span>
</section>
<section id="ln10-const" class="level4">
<h4 class="anchored" data-anchor-id="ln10-const">LN10 <sup><sub>CONST</sub></sup></h4>
<p><code>LN10 = 2.302585092994046</code></p>
<p><span class="math inline">\(\ln{10}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1075">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-LN2"></span>
</section>
<section id="ln2-const" class="level4">
<h4 class="anchored" data-anchor-id="ln2-const">LN2 <sup><sub>CONST</sub></sup></h4>
<p><code>LN2 = 0.6931471805599453</code></p>
<p><span class="math inline">\(\ln{2}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1072">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-LN2_2"></span>
</section>
<section id="ln2_2-const" class="level4">
<h4 class="anchored" data-anchor-id="ln2_2-const">LN2_2 <sup><sub>CONST</sub></sup></h4>
<p><code>LN2_2 = 0.34657359027997264</code></p>
<p><span class="math inline">\(\frac{\ln{2}}{2}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1074">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-LOG10E"></span>
</section>
<section id="log10e-const" class="level4">
<h4 class="anchored" data-anchor-id="log10e-const">LOG10E <sup><sub>CONST</sub></sup></h4>
<p><code>LOG10E = 0.4342944819032518</code></p>
<p><span class="math inline">\(\log_{10}{e}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1343">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-LOG2E"></span>
</section>
<section id="log2e-const" class="level4">
<h4 class="anchored" data-anchor-id="log2e-const">LOG2E <sup><sub>CONST</sub></sup></h4>
<p><code>LOG2E = 1.4426950408889634</code></p>
<p><span class="math inline">\(\log_{2}{e}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1340">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-LOG_HALF"></span>
</section>
<section id="log_half-const" class="level4">
<h4 class="anchored" data-anchor-id="log_half-const">LOG_HALF <sup><sub>CONST</sub></sup></h4>
<p><code>LOG_HALF = -0.6931471805599453</code></p>
<p><span class="math inline">\(\ln{0.5}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1077">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-LOG_PI"></span>
</section>
<section id="log_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="log_pi-const">LOG_PI <sup><sub>CONST</sub></sup></h4>
<p><code>LOG_PI = 1.1447298858494002</code></p>
<p><span class="math inline">\(\ln{\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1078">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-LOG_TWO_PI"></span>
</section>
<section id="log_two_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="log_two_pi-const">LOG_TWO_PI <sup><sub>CONST</sub></sup></h4>
<p><code>LOG_TWO_PI = 1.8378770664093453</code></p>
<p><span class="math inline">\(\ln{2 \pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1079">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-MACHINE-EPSILON"></span>
</section>
<section id="machine-epsilon-const" class="level4">
<h4 class="anchored" data-anchor-id="machine-epsilon-const">MACHINE-EPSILON <sup><sub>CONST</sub></sup></h4>
<p><code>MACHINE-EPSILON = 1.1102230246251565E-16</code></p>
<p>ULP(1)/2. Half of the smallest difference between 1.0 and next possible double floating point number.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L666">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-MACHINE-EPSILON10"></span>
</section>
<section id="machine-epsilon10-const" class="level4">
<h4 class="anchored" data-anchor-id="machine-epsilon10-const">MACHINE-EPSILON10 <sup><sub>CONST</sub></sup></h4>
<p><code>MACHINE-EPSILON10 = 1.1102230246251565E-15</code></p>
<p>5*ULP(1)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L672">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_1_PI"></span>
</section>
<section id="m_1_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="m_1_pi-const">M_1_PI <sup><sub>CONST</sub></sup></h4>
<p><code>M_1_PI = 0.3183098861837907</code></p>
<p><span class="math inline">\(\frac{1}{\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1826">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_2_PI"></span>
</section>
<section id="m_2_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="m_2_pi-const">M_2_PI <sup><sub>CONST</sub></sup></h4>
<p><code>M_2_PI = 0.6366197723675814</code></p>
<p><span class="math inline">\(\frac{2}{\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1827">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_2_SQRTPI"></span>
</section>
<section id="m_2_sqrtpi-const" class="level4">
<h4 class="anchored" data-anchor-id="m_2_sqrtpi-const">M_2_SQRTPI <sup><sub>CONST</sub></sup></h4>
<p><code>M_2_SQRTPI = 1.1283791670955126</code></p>
<p><span class="math inline">\(\frac{2}{\sqrt\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1828">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_3PI_4"></span>
</section>
<section id="m_3pi_4-const" class="level4">
<h4 class="anchored" data-anchor-id="m_3pi_4-const">M_3PI_4 <sup><sub>CONST</sub></sup></h4>
<p><code>M_3PI_4 = 2.356194490192345</code></p>
<p><span class="math inline">\(\frac{3\pi}{4}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1836">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_E"></span>
</section>
<section id="m_e-const" class="level4">
<h4 class="anchored" data-anchor-id="m_e-const">M_E <sup><sub>CONST</sub></sup></h4>
<p><code>M_E = 2.718281828459045</code></p>
<p><span class="math inline">\(e\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1818">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_INVLN2"></span>
</section>
<section id="m_invln2-const" class="level4">
<h4 class="anchored" data-anchor-id="m_invln2-const">M_INVLN2 <sup><sub>CONST</sub></sup></h4>
<p><code>M_INVLN2 = 1.4426950408889634</code></p>
<p><span class="math inline">\(\frac{1}{\ln{2}}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1841">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_IVLN10"></span>
</section>
<section id="m_ivln10-const" class="level4">
<h4 class="anchored" data-anchor-id="m_ivln10-const">M_IVLN10 <sup><sub>CONST</sub></sup></h4>
<p><code>M_IVLN10 = 0.43429448190325176</code></p>
<p><span class="math inline">\(\frac{1}{\ln{10}}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1839">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_LN10"></span>
</section>
<section id="m_ln10-const" class="level4">
<h4 class="anchored" data-anchor-id="m_ln10-const">M_LN10 <sup><sub>CONST</sub></sup></h4>
<p><code>M_LN10 = 2.302585092994046</code></p>
<p><span class="math inline">\(\ln{10}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1822">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_LN2"></span>
</section>
<section id="m_ln2-const" class="level4">
<h4 class="anchored" data-anchor-id="m_ln2-const">M_LN2 <sup><sub>CONST</sub></sup></h4>
<p><code>M_LN2 = 0.6931471805599453</code></p>
<p><span class="math inline">\(\ln{2}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1821">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_LOG10E"></span>
</section>
<section id="m_log10e-const" class="level4">
<h4 class="anchored" data-anchor-id="m_log10e-const">M_LOG10E <sup><sub>CONST</sub></sup></h4>
<p><code>M_LOG10E = 0.4342944819032518</code></p>
<p><span class="math inline">\(\log_{10}{e}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1820">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_LOG2E"></span>
</section>
<section id="m_log2e-const" class="level4">
<h4 class="anchored" data-anchor-id="m_log2e-const">M_LOG2E <sup><sub>CONST</sub></sup></h4>
<p><code>M_LOG2E = 1.4426950408889634</code></p>
<p><span class="math inline">\(\log_{2}{e}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1819">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_LOG2_E"></span>
</section>
<section id="m_log2_e-const" class="level4">
<h4 class="anchored" data-anchor-id="m_log2_e-const">M_LOG2_E <sup><sub>CONST</sub></sup></h4>
<p><code>M_LOG2_E = 0.6931471805599453</code></p>
<p><span class="math inline">\(\ln{2}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1840">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_PI"></span>
</section>
<section id="m_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="m_pi-const">M_PI <sup><sub>CONST</sub></sup></h4>
<p><code>M_PI = 3.141592653589793</code></p>
<p><span class="math inline">\(\pi\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1823">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_PI_2"></span>
</section>
<section id="m_pi_2-const" class="level4">
<h4 class="anchored" data-anchor-id="m_pi_2-const">M_PI_2 <sup><sub>CONST</sub></sup></h4>
<p><code>M_PI_2 = 1.5707963267948966</code></p>
<p><span class="math inline">\(\frac{\pi}{2}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1824">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_PI_4"></span>
</section>
<section id="m_pi_4-const" class="level4">
<h4 class="anchored" data-anchor-id="m_pi_4-const">M_PI_4 <sup><sub>CONST</sub></sup></h4>
<p><code>M_PI_4 = 0.7853981633974483</code></p>
<p><span class="math inline">\(\frac{\pi}{4}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1825">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_SQRT1_2"></span>
</section>
<section id="m_sqrt1_2-const" class="level4">
<h4 class="anchored" data-anchor-id="m_sqrt1_2-const">M_SQRT1_2 <sup><sub>CONST</sub></sup></h4>
<p><code>M_SQRT1_2 = 0.7071067811865475</code></p>
<p><span class="math inline">\(\frac{1}{\sqrt{2}}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1833">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_SQRT2"></span>
</section>
<section id="m_sqrt2-const" class="level4">
<h4 class="anchored" data-anchor-id="m_sqrt2-const">M_SQRT2 <sup><sub>CONST</sub></sup></h4>
<p><code>M_SQRT2 = 1.4142135623730951</code></p>
<p><span class="math inline">\(\sqrt{2}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1832">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_SQRT3"></span>
</section>
<section id="m_sqrt3-const" class="level4">
<h4 class="anchored" data-anchor-id="m_sqrt3-const">M_SQRT3 <sup><sub>CONST</sub></sup></h4>
<p><code>M_SQRT3 = 1.7320508075688772</code></p>
<p><span class="math inline">\(\sqrt{3}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1838">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_SQRT_PI"></span>
</section>
<section id="m_sqrt_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="m_sqrt_pi-const">M_SQRT_PI <sup><sub>CONST</sub></sup></h4>
<p><code>M_SQRT_PI = 1.7724538509055159</code></p>
<p><span class="math inline">\(\sqrt\pi\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1837">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-M_TWOPI"></span>
</section>
<section id="m_twopi-const" class="level4">
<h4 class="anchored" data-anchor-id="m_twopi-const">M_TWOPI <sup><sub>CONST</sub></sup></h4>
<p><code>M_TWOPI = 6.283185307179586</code></p>
<p><span class="math inline">\(2\pi\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1835">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ONE_SIXTH"></span>
</section>
<section id="one_sixth-const" class="level4">
<h4 class="anchored" data-anchor-id="one_sixth-const">ONE_SIXTH <sup><sub>CONST</sub></sup></h4>
<p><code>ONE_SIXTH = 0.16666666666666666</code></p>
<p>Value of <span class="math inline">\(\frac{1}{6}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L680">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ONE_THIRD"></span>
</section>
<section id="one_third-const" class="level4">
<h4 class="anchored" data-anchor-id="one_third-const">ONE_THIRD <sup><sub>CONST</sub></sup></h4>
<p><code>ONE_THIRD = 0.3333333333333333</code></p>
<p>Value of <span class="math inline">\(\frac{1}{3}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L676">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-PHI"></span>
</section>
<section id="phi-const" class="level4">
<h4 class="anchored" data-anchor-id="phi-const">PHI <sup><sub>CONST</sub></sup></h4>
<p><code>PHI = 1.618033988749895</code></p>
<p>Golden ratio <span class="math inline">\(\phi\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1814">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-PI"></span>
</section>
<section id="pi-const-1" class="level4">
<h4 class="anchored" data-anchor-id="pi-const-1">PI <sup><sub>CONST</sub></sup></h4>
<p><code>PI = 3.141592653589793</code></p>
<p>Value of <span class="math inline">\(\pi\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L642">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-QUARTER_PI"></span>
</section>
<section id="quarter_pi-const-1" class="level4">
<h4 class="anchored" data-anchor-id="quarter_pi-const-1">QUARTER_PI <sup><sub>CONST</sub></sup></h4>
<p><code>QUARTER_PI = 0.7853981633974483</code></p>
<p>Value of <span class="math inline">\(\frac{\pi}{4}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L645">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-SILVER"></span>
</section>
<section id="silver-const" class="level4">
<h4 class="anchored" data-anchor-id="silver-const">SILVER <sup><sub>CONST</sub></sup></h4>
<p><code>SILVER = 2.414213562373095</code></p>
<p>Silver ratio <span class="math inline">\(\delta_S\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1815">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-SIXTH"></span>
</section>
<section id="sixth-const" class="level4">
<h4 class="anchored" data-anchor-id="sixth-const">SIXTH <sup><sub>CONST</sub></sup></h4>
<p><code>SIXTH = 0.16666666666666666</code></p>
<p>Value of <span class="math inline">\(\frac{1}{6}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L679">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-SQRT2"></span>
</section>
<section id="sqrt2-const" class="level4">
<h4 class="anchored" data-anchor-id="sqrt2-const">SQRT2 <sup><sub>CONST</sub></sup></h4>
<p><code>SQRT2 = 1.4142135623730951</code></p>
<p><span class="math inline">\(\sqrt{2}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1796">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-SQRT2PI"></span>
</section>
<section id="sqrt2pi-const" class="level4">
<h4 class="anchored" data-anchor-id="sqrt2pi-const">SQRT2PI <sup><sub>CONST</sub></sup></h4>
<p><code>SQRT2PI = 2.5066282746310002</code></p>
<p><span class="math inline">\(\sqrt{2\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1810">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-SQRT2_2"></span>
</section>
<section id="sqrt2_2-const" class="level4">
<h4 class="anchored" data-anchor-id="sqrt2_2-const">SQRT2_2 <sup><sub>CONST</sub></sup></h4>
<p><code>SQRT2_2 = 0.7071067811865476</code></p>
<p><span class="math inline">\(\frac{\sqrt{2}}{2}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1797">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-SQRT3"></span>
</section>
<section id="sqrt3-const" class="level4">
<h4 class="anchored" data-anchor-id="sqrt3-const">SQRT3 <sup><sub>CONST</sub></sup></h4>
<p><code>SQRT3 = 1.7320508075688772</code></p>
<p><span class="math inline">\(\sqrt{3}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1800">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-SQRT3_2"></span>
</section>
<section id="sqrt3_2-const" class="level4">
<h4 class="anchored" data-anchor-id="sqrt3_2-const">SQRT3_2 <sup><sub>CONST</sub></sup></h4>
<p><code>SQRT3_2 = 0.8660254037844386</code></p>
<p><span class="math inline">\(\frac{\sqrt{3}}{2}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1801">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-SQRT3_3"></span>
</section>
<section id="sqrt3_3-const" class="level4">
<h4 class="anchored" data-anchor-id="sqrt3_3-const">SQRT3_3 <sup><sub>CONST</sub></sup></h4>
<p><code>SQRT3_3 = 0.5773502691896257</code></p>
<p><span class="math inline">\(\frac{\sqrt{3}}{3}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1802">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-SQRT3_4"></span>
</section>
<section id="sqrt3_4-const" class="level4">
<h4 class="anchored" data-anchor-id="sqrt3_4-const">SQRT3_4 <sup><sub>CONST</sub></sup></h4>
<p><code>SQRT3_4 = 0.4330127018922193</code></p>
<p><span class="math inline">\(\frac{\sqrt{3}}{4}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1803">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-SQRT5"></span>
</section>
<section id="sqrt5-const" class="level4">
<h4 class="anchored" data-anchor-id="sqrt5-const">SQRT5 <sup><sub>CONST</sub></sup></h4>
<p><code>SQRT5 = 2.23606797749979</code></p>
<p><span class="math inline">\(\sqrt{5}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1806">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-SQRTPI"></span>
</section>
<section id="sqrtpi-const" class="level4">
<h4 class="anchored" data-anchor-id="sqrtpi-const">SQRTPI <sup><sub>CONST</sub></sup></h4>
<p><code>SQRTPI = 1.7724538509055159</code></p>
<p><span class="math inline">\(\sqrt{\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1809">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-SQRT_2_PI"></span>
</section>
<section id="sqrt_2_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="sqrt_2_pi-const">SQRT_2_PI <sup><sub>CONST</sub></sup></h4>
<p><code>SQRT_2_PI = 0.7978845608028654</code></p>
<p><span class="math inline">\(\sqrt{\frac{2}{\pi}}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1831">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-SQRT_HALFPI"></span>
</section>
<section id="sqrt_halfpi-const" class="level4">
<h4 class="anchored" data-anchor-id="sqrt_halfpi-const">SQRT_HALFPI <sup><sub>CONST</sub></sup></h4>
<p><code>SQRT_HALFPI = 1.2533141373155001</code></p>
<p><span class="math inline">\(\sqrt{\frac{1}{2}\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1811">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-TAU"></span>
</section>
<section id="tau-const-1" class="level4">
<h4 class="anchored" data-anchor-id="tau-const-1">TAU <sup><sub>CONST</sub></sup></h4>
<p><code>TAU = 6.283185307179586</code></p>
<p>Alias for <a href="#LOS-TWO_PI">TWO_PI</a></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L647">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-THIRD"></span>
</section>
<section id="third-const" class="level4">
<h4 class="anchored" data-anchor-id="third-const">THIRD <sup><sub>CONST</sub></sup></h4>
<p><code>THIRD = 0.3333333333333333</code></p>
<p>Value of <span class="math inline">\(\frac{1}{3}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L675">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-THIRD_PI"></span>
</section>
<section id="third_pi-const-1" class="level4">
<h4 class="anchored" data-anchor-id="third_pi-const-1">THIRD_PI <sup><sub>CONST</sub></sup></h4>
<p><code>THIRD_PI = 1.0471975511965976</code></p>
<p>Value of <span class="math inline">\(\frac{\pi}{3}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L644">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-TWO_INV_PI"></span>
</section>
<section id="two_inv_pi-const" class="level4">
<h4 class="anchored" data-anchor-id="two_inv_pi-const">TWO_INV_PI <sup><sub>CONST</sub></sup></h4>
<p><code>TWO_INV_PI = 0.6366197723675814</code></p>
<p>Value of <span class="math inline">\(\frac{2}{\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L657">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-TWO_PI"></span>
</section>
<section id="two_pi-const-1" class="level4">
<h4 class="anchored" data-anchor-id="two_pi-const-1">TWO_PI <sup><sub>CONST</sub></sup></h4>
<p><code>TWO_PI = 6.283185307179586</code></p>
<p>Value of <span class="math inline">\(2 {\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L646">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-TWO_THIRD"></span>
</section>
<section id="two_third-const" class="level4">
<h4 class="anchored" data-anchor-id="two_third-const">TWO_THIRD <sup><sub>CONST</sub></sup></h4>
<p><code>TWO_THIRD = 0.6666666666666666</code></p>
<p>Value of <span class="math inline">\(\frac{2}{3}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L677">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-TWO_THIRDS"></span>
</section>
<section id="two_thirds-const" class="level4">
<h4 class="anchored" data-anchor-id="two_thirds-const">TWO_THIRDS <sup><sub>CONST</sub></sup></h4>
<p><code>TWO_THIRDS = 0.6666666666666666</code></p>
<p>Value of <span class="math inline">\(\frac{2}{3}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L678">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-abs"></span>
</section>
<section id="abs" class="level4">
<h4 class="anchored" data-anchor-id="abs">abs</h4>
<ul>
<li><code>(abs x)</code></li>
</ul>
<p>Primitive and inlined version of abs.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1613">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-acos"></span>
</section>
<section id="acos" class="level4">
<h4 class="anchored" data-anchor-id="acos">acos</h4>
<ul>
<li><code>(acos x)</code></li>
</ul>
<p>acos(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L724">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-acosh"></span>
</section>
<section id="acosh" class="level4">
<h4 class="anchored" data-anchor-id="acosh">acosh</h4>
<ul>
<li><code>(acosh x)</code></li>
</ul>
<p>acosh(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L760">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-acot"></span>
</section>
<section id="acot" class="level4">
<h4 class="anchored" data-anchor-id="acot">acot</h4>
<ul>
<li><code>(acot x)</code></li>
</ul>
<p>acot(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L824">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-acoth"></span>
</section>
<section id="acoth" class="level4">
<h4 class="anchored" data-anchor-id="acoth">acoth</h4>
<ul>
<li><code>(acoth x)</code></li>
</ul>
<p>Area hyperbolic cotangent</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L868">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-acovercos"></span>
</section>
<section id="acovercos" class="level4">
<h4 class="anchored" data-anchor-id="acovercos">acovercos</h4>
<ul>
<li><code>(acovercos x)</code></li>
</ul>
<p>Arc covercosine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L942">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-acoversin"></span>
</section>
<section id="acoversin" class="level4">
<h4 class="anchored" data-anchor-id="acoversin">acoversin</h4>
<ul>
<li><code>(acoversin x)</code></li>
</ul>
<p>Arc coversine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L930">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-acrd"></span>
</section>
<section id="acrd" class="level4">
<h4 class="anchored" data-anchor-id="acrd">acrd</h4>
<ul>
<li><code>(acrd x)</code></li>
</ul>
<p>Inverse chord</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L894">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-acsc"></span>
</section>
<section id="acsc" class="level4">
<h4 class="anchored" data-anchor-id="acsc">acsc</h4>
<ul>
<li><code>(acsc x)</code></li>
</ul>
<p>acsc(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L836">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-acsch"></span>
</section>
<section id="acsch" class="level4">
<h4 class="anchored" data-anchor-id="acsch">acsch</h4>
<ul>
<li><code>(acsch v)</code></li>
</ul>
<p>Area hyperbolic cosecant</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L880">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-aexcsc"></span>
</section>
<section id="aexcsc" class="level4">
<h4 class="anchored" data-anchor-id="aexcsc">aexcsc</h4>
<ul>
<li><code>(aexcsc x)</code></li>
</ul>
<p>Arc excosecant</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1023">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-aexsec"></span>
</section>
<section id="aexsec" class="level4">
<h4 class="anchored" data-anchor-id="aexsec">aexsec</h4>
<ul>
<li><code>(aexsec x)</code></li>
</ul>
<p>Arc exsecant</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1017">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ahacovercos"></span>
</section>
<section id="ahacovercos" class="level4">
<h4 class="anchored" data-anchor-id="ahacovercos">ahacovercos</h4>
<ul>
<li><code>(ahacovercos x)</code></li>
</ul>
<p>Arc hacovercosine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L999">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ahacoversin"></span>
</section>
<section id="ahacoversin" class="level4">
<h4 class="anchored" data-anchor-id="ahacoversin">ahacoversin</h4>
<ul>
<li><code>(ahacoversin x)</code></li>
</ul>
<p>Arc hacoversine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L987">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ahavercos"></span>
</section>
<section id="ahavercos" class="level4">
<h4 class="anchored" data-anchor-id="ahavercos">ahavercos</h4>
<ul>
<li><code>(ahavercos x)</code></li>
</ul>
<p>Arc havecosine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L993">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ahaversin"></span>
</section>
<section id="ahaversin" class="level4">
<h4 class="anchored" data-anchor-id="ahaversin">ahaversin</h4>
<ul>
<li><code>(ahaversin x)</code></li>
</ul>
<p>Arc haversine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L981">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-approx"></span>
</section>
<section id="approx" class="level4">
<h4 class="anchored" data-anchor-id="approx">approx</h4>
<ul>
<li><code>(approx v)</code></li>
<li><code>(approx v digits)</code></li>
</ul>
<p>Round <code>v</code> to specified (default: 2) decimal places. Be aware of floating point number accuracy.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1641">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-approx-eq"></span>
</section>
<section id="approx-eq" class="level4">
<h4 class="anchored" data-anchor-id="approx-eq">approx-eq</h4>
<ul>
<li><code>(approx-eq a b)</code></li>
<li><code>(approx-eq a b digits)</code></li>
</ul>
<p>Checks equality approximately. See <a href="#LOS-approx">approx</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1646">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-approx="></span>
</section>
<section id="approx-1" class="level4">
<h4 class="anchored" data-anchor-id="approx-1">approx=</h4>
<p>Alias for <a href="#LOS-approx-eq">approx-eq</a></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1663">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-asec"></span>
</section>
<section id="asec" class="level4">
<h4 class="anchored" data-anchor-id="asec">asec</h4>
<ul>
<li><code>(asec x)</code></li>
</ul>
<p>asec(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L830">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-asech"></span>
</section>
<section id="asech" class="level4">
<h4 class="anchored" data-anchor-id="asech">asech</h4>
<ul>
<li><code>(asech x)</code></li>
</ul>
<p>Area hyperbolic secant</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L874">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-asin"></span>
</section>
<section id="asin" class="level4">
<h4 class="anchored" data-anchor-id="asin">asin</h4>
<ul>
<li><code>(asin x)</code></li>
</ul>
<p>asin(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L718">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-asinh"></span>
</section>
<section id="asinh" class="level4">
<h4 class="anchored" data-anchor-id="asinh">asinh</h4>
<ul>
<li><code>(asinh x)</code></li>
</ul>
<p>asinh(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L754">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-atan"></span>
</section>
<section id="atan" class="level4">
<h4 class="anchored" data-anchor-id="atan">atan</h4>
<ul>
<li><code>(atan x)</code></li>
</ul>
<p>atan(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L730">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-atan2"></span>
</section>
<section id="atan2" class="level4">
<h4 class="anchored" data-anchor-id="atan2">atan2</h4>
<ul>
<li><code>(atan2 x y)</code></li>
</ul>
<p>atan2(x,y)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L842">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-atanh"></span>
</section>
<section id="atanh" class="level4">
<h4 class="anchored" data-anchor-id="atanh">atanh</h4>
<ul>
<li><code>(atanh x)</code></li>
</ul>
<p>atanh(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L766">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-avercos"></span>
</section>
<section id="avercos" class="level4">
<h4 class="anchored" data-anchor-id="avercos">avercos</h4>
<ul>
<li><code>(avercos x)</code></li>
</ul>
<p>Arc vecosine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L936">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-aversin"></span>
</section>
<section id="aversin" class="level4">
<h4 class="anchored" data-anchor-id="aversin">aversin</h4>
<ul>
<li><code>(aversin x)</code></li>
</ul>
<p>Arc versine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L924">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-between-?"></span>
</section>
<section id="between-" class="level4">
<h4 class="anchored" data-anchor-id="between-">between-?</h4>
<ul>
<li><code>(between-? [x y] v)</code></li>
<li><code>(between-? x y v)</code></li>
</ul>
<p>Check if given number is within the range (x,y].</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2064">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-between?"></span>
</section>
<section id="between" class="level4">
<h4 class="anchored" data-anchor-id="between">between?</h4>
<ul>
<li><code>(between? [x y] v)</code></li>
<li><code>(between? x y v)</code></li>
</ul>
<p>Check if given number is within the range [x,y].</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2057">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-and"></span>
</section>
<section id="bit-and" class="level4">
<h4 class="anchored" data-anchor-id="bit-and">bit-and</h4>
<ul>
<li><code>(bit-and x)</code></li>
<li><code>(bit-and x y)</code></li>
<li><code>(bit-and x y &amp; r)</code></li>
</ul>
<p>x ∧ y - bitwise AND</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L420">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-and-not"></span>
</section>
<section id="bit-and-not" class="level4">
<h4 class="anchored" data-anchor-id="bit-and-not">bit-and-not</h4>
<ul>
<li><code>(bit-and-not x)</code></li>
<li><code>(bit-and-not x y)</code></li>
<li><code>(bit-and-not x y &amp; r)</code></li>
</ul>
<p>x ∧ ~y - bitwise AND (with complement second argument)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L436">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-clear"></span>
</section>
<section id="bit-clear" class="level4">
<h4 class="anchored" data-anchor-id="bit-clear">bit-clear</h4>
<ul>
<li><code>(bit-clear x bit)</code></li>
</ul>
<p>Clear bit (set to <code>0</code>).</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L488">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-flip"></span>
</section>
<section id="bit-flip" class="level4">
<h4 class="anchored" data-anchor-id="bit-flip">bit-flip</h4>
<ul>
<li><code>(bit-flip x bit)</code></li>
</ul>
<p>Flip bit (set to <code>0</code> when <code>1</code> or to <code>1</code> when <code>0</code>).</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L494">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-nand"></span>
</section>
<section id="bit-nand" class="level4">
<h4 class="anchored" data-anchor-id="bit-nand">bit-nand</h4>
<ul>
<li><code>(bit-nand x)</code></li>
<li><code>(bit-nand x y)</code></li>
<li><code>(bit-nand x y &amp; r)</code></li>
</ul>
<p>~(x ∧ y) - bitwise NAND</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L428">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-nor"></span>
</section>
<section id="bit-nor" class="level4">
<h4 class="anchored" data-anchor-id="bit-nor">bit-nor</h4>
<ul>
<li><code>(bit-nor x)</code></li>
<li><code>(bit-nor x y)</code></li>
<li><code>(bit-nor x y &amp; r)</code></li>
</ul>
<p>~(x ∨ y) - bitwise NOR</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L452">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-not"></span>
</section>
<section id="bit-not" class="level4">
<h4 class="anchored" data-anchor-id="bit-not">bit-not</h4>
<ul>
<li><code>(bit-not x)</code></li>
</ul>
<p>~x - bitwise NOT</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L476">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-or"></span>
</section>
<section id="bit-or" class="level4">
<h4 class="anchored" data-anchor-id="bit-or">bit-or</h4>
<ul>
<li><code>(bit-or x)</code></li>
<li><code>(bit-or x y)</code></li>
<li><code>(bit-or x y &amp; r)</code></li>
</ul>
<p>x ∨ y - bitwise OR</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L444">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-set"></span>
</section>
<section id="bit-set" class="level4">
<h4 class="anchored" data-anchor-id="bit-set">bit-set</h4>
<ul>
<li><code>(bit-set x bit)</code></li>
</ul>
<p>Set bit (set to <code>1</code>).</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L482">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-shift-left"></span>
</section>
<section id="bit-shift-left" class="level4">
<h4 class="anchored" data-anchor-id="bit-shift-left">bit-shift-left</h4>
<ul>
<li><code>(bit-shift-left x shift)</code></li>
</ul>
<p>Shift bits left</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L506">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-shift-right"></span>
</section>
<section id="bit-shift-right" class="level4">
<h4 class="anchored" data-anchor-id="bit-shift-right">bit-shift-right</h4>
<ul>
<li><code>(bit-shift-right x shift)</code></li>
</ul>
<p>Shift bits right and keep most significant bit unchanged</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L518">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-test"></span>
</section>
<section id="bit-test" class="level4">
<h4 class="anchored" data-anchor-id="bit-test">bit-test</h4>
<ul>
<li><code>(bit-test x bit)</code></li>
</ul>
<p>Test bit (return to <code>true</code> when <code>1</code> or <code>false</code> when <code>0</code>).</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L500">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-xnor"></span>
</section>
<section id="bit-xnor" class="level4">
<h4 class="anchored" data-anchor-id="bit-xnor">bit-xnor</h4>
<ul>
<li><code>(bit-xnor x)</code></li>
<li><code>(bit-xnor x y)</code></li>
<li><code>(bit-xnor x y &amp; r)</code></li>
</ul>
<p>~(x⊕y) - bitwise XNOR</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L468">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bit-xor"></span>
</section>
<section id="bit-xor" class="level4">
<h4 class="anchored" data-anchor-id="bit-xor">bit-xor</h4>
<ul>
<li><code>(bit-xor x)</code></li>
<li><code>(bit-xor x y)</code></li>
<li><code>(bit-xor x y &amp; r)</code></li>
</ul>
<p>x⊕y - bitwise XOR</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L460">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bits->double"></span>
</section>
<section id="bits-double" class="level4">
<h4 class="anchored" data-anchor-id="bits-double">bits-&gt;double</h4>
<ul>
<li><code>(bits-&gt;double v)</code></li>
</ul>
<p>Convert 64 bits to double</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1753">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bool-not"></span>
</section>
<section id="bool-not" class="level4">
<h4 class="anchored" data-anchor-id="bool-not">bool-not</h4>
<ul>
<li><code>(bool-not x)</code></li>
</ul>
<p>Primitive boolean not</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L542">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bool-xor"></span>
</section>
<section id="bool-xor" class="level4">
<h4 class="anchored" data-anchor-id="bool-xor">bool-xor</h4>
<ul>
<li><code>(bool-xor x y)</code></li>
<li><code>(bool-xor x y &amp; r)</code></li>
</ul>
<p>Primitive boolean xor</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L548">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cb"></span>
</section>
<section id="cb" class="level4">
<h4 class="anchored" data-anchor-id="cb">cb</h4>
<ul>
<li><code>(cb x)</code></li>
</ul>
<p><span class="math inline">\(x^3\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1476">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cbrt"></span>
</section>
<section id="cbrt" class="level4">
<h4 class="anchored" data-anchor-id="cbrt">cbrt</h4>
<ul>
<li><code>(cbrt x)</code></li>
</ul>
<p><span class="math inline">\(\sqrt[3]{x}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1257">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ceil"></span>
</section>
<section id="ceil" class="level4">
<h4 class="anchored" data-anchor-id="ceil">ceil</h4>
<ul>
<li><code>(ceil x)</code></li>
<li><code>(ceil x scale)</code></li>
</ul>
<p><span class="math inline">\(\lceil x \rceil\)</span>. See: <a href="#LOS-qceil">qceil</a>.</p>
<p>Rounding is done to a multiply of scale value (when provided).</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1556">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cexpexp"></span>
</section>
<section id="cexpexp" class="level4">
<h4 class="anchored" data-anchor-id="cexpexp">cexpexp</h4>
<ul>
<li><code>(cexpexp x)</code></li>
</ul>
<p>1-exp(-exp(x))</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1229">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cloglog"></span>
</section>
<section id="cloglog" class="level4">
<h4 class="anchored" data-anchor-id="cloglog">cloglog</h4>
<ul>
<li><code>(cloglog x)</code></li>
</ul>
<p>log(-log(1-x))</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1202">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cnorm"></span>
</section>
<section id="cnorm" class="level4">
<h4 class="anchored" data-anchor-id="cnorm">cnorm</h4>
<ul>
<li><code>(cnorm v start1 stop1 start2 stop2)</code></li>
<li><code>(cnorm v start stop)</code></li>
</ul>
<p>Constrained version of norm. Result of <a href="#LOS-norm">norm</a> is applied to <a href="#LOS-constrain">constrain</a> to <code>[0,1]</code> or <code>[start2,stop2]</code> ranges.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1902">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-co-intervals"></span>
</section>
<section id="co-intervals" class="level4">
<h4 class="anchored" data-anchor-id="co-intervals">co-intervals</h4>
<ul>
<li><code>(co-intervals data)</code></li>
<li><code>(co-intervals data number)</code></li>
<li><code>(co-intervals data number overlap)</code></li>
</ul>
<p>Divide sequence to overlaping intervals containing similar number of values. Same as R’s <code>co.intervals()</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2091">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-combinations"></span>
</section>
<section id="combinations" class="level4">
<h4 class="anchored" data-anchor-id="combinations">combinations</h4>
<ul>
<li><code>(combinations n k)</code></li>
</ul>
<p>Binomial coefficient (n choose k)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1432">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-constrain"></span>
</section>
<section id="constrain-macro" class="level4">
<h4 class="anchored" data-anchor-id="constrain-macro">constrain <sup><sub>MACRO</sub></sup></h4>
<ul>
<li><code>(constrain value mn mx)</code></li>
</ul>
<p>Clamp <code>value</code> to the range <code>[mn,mx]</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1868">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-copy-sign"></span>
</section>
<section id="copy-sign" class="level4">
<h4 class="anchored" data-anchor-id="copy-sign">copy-sign</h4>
<ul>
<li><code>(copy-sign magnitude sign)</code></li>
</ul>
<p>Returns a value with a magnitude of first argument and sign of second.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1861">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cos"></span>
</section>
<section id="cos" class="level4">
<h4 class="anchored" data-anchor-id="cos">cos</h4>
<ul>
<li><code>(cos x)</code></li>
</ul>
<p>cos(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L694">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cos-interpolation"></span>
</section>
<section id="cos-interpolation" class="level4">
<h4 class="anchored" data-anchor-id="cos-interpolation">cos-interpolation</h4>
<ul>
<li><code>(cos-interpolation start stop t)</code></li>
</ul>
<p>oF interpolateCosine interpolation. See also <a href="#LOS-lerp">lerp</a>/<a href="#LOS-mlerp">mlerp</a>, <a href="#LOS-quad-interpolation">quad-interpolation</a> or <a href="#LOS-smooth-interpolation">smooth-interpolation</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1936">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cosh"></span>
</section>
<section id="cosh" class="level4">
<h4 class="anchored" data-anchor-id="cosh">cosh</h4>
<ul>
<li><code>(cosh x)</code></li>
</ul>
<p>cosh(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L742">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cospi"></span>
</section>
<section id="cospi" class="level4">
<h4 class="anchored" data-anchor-id="cospi">cospi</h4>
<ul>
<li><code>(cospi x)</code></li>
</ul>
<p>cos(pi*x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L700">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cot"></span>
</section>
<section id="cot" class="level4">
<h4 class="anchored" data-anchor-id="cot">cot</h4>
<ul>
<li><code>(cot x)</code></li>
</ul>
<p>cot(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L786">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-coth"></span>
</section>
<section id="coth" class="level4">
<h4 class="anchored" data-anchor-id="coth">coth</h4>
<ul>
<li><code>(coth x)</code></li>
</ul>
<p>Hyperbolic cotangent</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L849">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cotpi"></span>
</section>
<section id="cotpi" class="level4">
<h4 class="anchored" data-anchor-id="cotpi">cotpi</h4>
<ul>
<li><code>(cotpi x)</code></li>
</ul>
<p>cot(pi*x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L792">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-covercos"></span>
</section>
<section id="covercos" class="level4">
<h4 class="anchored" data-anchor-id="covercos">covercos</h4>
<ul>
<li><code>(covercos x)</code></li>
</ul>
<p>Covercosine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L918">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-coversin"></span>
</section>
<section id="coversin" class="level4">
<h4 class="anchored" data-anchor-id="coversin">coversin</h4>
<ul>
<li><code>(coversin x)</code></li>
</ul>
<p>Coversine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L906">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-crd"></span>
</section>
<section id="crd" class="level4">
<h4 class="anchored" data-anchor-id="crd">crd</h4>
<ul>
<li><code>(crd x)</code></li>
</ul>
<p>Chord</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L888">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-csc"></span>
</section>
<section id="csc" class="level4">
<h4 class="anchored" data-anchor-id="csc">csc</h4>
<ul>
<li><code>(csc x)</code></li>
</ul>
<p>csc(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L810">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-csch"></span>
</section>
<section id="csch" class="level4">
<h4 class="anchored" data-anchor-id="csch">csch</h4>
<ul>
<li><code>(csch x)</code></li>
</ul>
<p>Hyperbolic cosecant</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L861">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cscpi"></span>
</section>
<section id="cscpi" class="level4">
<h4 class="anchored" data-anchor-id="cscpi">cscpi</h4>
<ul>
<li><code>(cscpi x)</code></li>
</ul>
<p>csc(pi*x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L816">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cut"></span>
</section>
<section id="cut" class="level4">
<h4 class="anchored" data-anchor-id="cut">cut</h4>
<ul>
<li><code>(cut data breaks)</code></li>
<li><code>(cut x1 x2 breaks)</code></li>
</ul>
<p>Cut range or sequence into intervals</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2081">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-dec"></span>
</section>
<section id="dec" class="level4">
<h4 class="anchored" data-anchor-id="dec">dec</h4>
<ul>
<li><code>(dec x)</code></li>
</ul>
<p>Primitive and inlined <code>dec</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L186">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-deg-in-rad"></span>
</section>
<section id="deg-in-rad-const" class="level4">
<h4 class="anchored" data-anchor-id="deg-in-rad-const">deg-in-rad <sup><sub>CONST</sub></sup></h4>
<p><code>deg-in-rad = 0.017453292519943295</code></p>
<p><span class="math inline">\(\frac{\pi}{180}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1272">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-degrees"></span>
</section>
<section id="degrees" class="level4">
<h4 class="anchored" data-anchor-id="degrees">degrees</h4>
<ul>
<li><code>(degrees rad)</code></li>
</ul>
<p>Convert radians into degrees.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1280">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-delta-eq"></span>
</section>
<section id="delta-eq" class="level4">
<h4 class="anchored" data-anchor-id="delta-eq">delta-eq</h4>
<ul>
<li><code>(delta-eq a b)</code></li>
<li><code>(delta-eq a b accuracy)</code></li>
<li><code>(delta-eq a b abs-tol rel-tol)</code></li>
</ul>
<p>Checks equality for given absolute accuracy (default <code>1.0e-6</code>).</p>
<p>Version with 4-arity accepts absolute and relative accuracy.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1653">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-delta="></span>
</section>
<section id="delta" class="level4">
<h4 class="anchored" data-anchor-id="delta">delta=</h4>
<p>Alias for <a href="#LOS-delta-eq">delta-eq</a></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1664">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-difference-of-products"></span>
</section>
<section id="difference-of-products" class="level4">
<h4 class="anchored" data-anchor-id="difference-of-products">difference-of-products</h4>
<ul>
<li><code>(difference-of-products a b c d)</code></li>
</ul>
<p>Kahan’s algorithm for (a<em>b)-(c</em>d) to avoid catastrophic cancellation.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L629">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-dist"></span>
</section>
<section id="dist" class="level4">
<h4 class="anchored" data-anchor-id="dist">dist</h4>
<ul>
<li><code>(dist [x1 y1] [x2 y2])</code></li>
<li><code>(dist x1 y1 x2 y2)</code></li>
</ul>
<p>Euclidean distance between points <code>(x1,y1)</code> and <code>(x2,y2)</code>. See <a href="#LOS-fastmath.vector">fastmath.vector</a> namespace to see other metrics which work on vectors.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1529">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-double-array->seq"></span>
</section>
<section id="double-array-seq" class="level4">
<h4 class="anchored" data-anchor-id="double-array-seq">double-array-&gt;seq</h4>
<p>Convert double array into sequence.</p>
<p>Alias for <code>seq</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2230">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-double-array-type"></span>
</section>
<section id="double-array-type" class="level4">
<h4 class="anchored" data-anchor-id="double-array-type">double-array-type</h4>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2227">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-double-bits"></span>
</section>
<section id="double-bits" class="level4">
<h4 class="anchored" data-anchor-id="double-bits">double-bits</h4>
<ul>
<li><code>(double-bits v)</code></li>
</ul>
<p>Returns double as 64-bits (long)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1746">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-double-double-array->seq"></span>
</section>
<section id="double-double-array-seq" class="level4">
<h4 class="anchored" data-anchor-id="double-double-array-seq">double-double-array-&gt;seq</h4>
<ul>
<li><code>(double-double-array-&gt;seq res)</code></li>
</ul>
<p>Convert double array of double arrays into sequence of sequences.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2245">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-double-double-array-type"></span>
</section>
<section id="double-double-array-type" class="level4">
<h4 class="anchored" data-anchor-id="double-double-array-type">double-double-array-type</h4>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2228">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-double-exponent"></span>
</section>
<section id="double-exponent" class="level4">
<h4 class="anchored" data-anchor-id="double-exponent">double-exponent</h4>
<ul>
<li><code>(double-exponent v)</code></li>
</ul>
<p>Extract exponent information from double</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1760">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-double-high-bits"></span>
</section>
<section id="double-high-bits" class="level4">
<h4 class="anchored" data-anchor-id="double-high-bits">double-high-bits</h4>
<ul>
<li><code>(double-high-bits v)</code></li>
</ul>
<p>Returns high word from double as bits</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1732">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-double-low-bits"></span>
</section>
<section id="double-low-bits" class="level4">
<h4 class="anchored" data-anchor-id="double-low-bits">double-low-bits</h4>
<ul>
<li><code>(double-low-bits v)</code></li>
</ul>
<p>Returns low word from double as bits</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1739">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-double-one-minus-epsilon"></span>
</section>
<section id="double-one-minus-epsilon-const" class="level4">
<h4 class="anchored" data-anchor-id="double-one-minus-epsilon-const">double-one-minus-epsilon <sup><sub>CONST</sub></sup></h4>
<p><code>double-one-minus-epsilon = 0.9999999999999999</code></p>
<p>Value of 0x1.fffffffffffffp-1d = 0.(9)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1792">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-double-significand"></span>
</section>
<section id="double-significand" class="level4">
<h4 class="anchored" data-anchor-id="double-significand">double-significand</h4>
<ul>
<li><code>(double-significand v)</code></li>
</ul>
<p>Extract significand from double</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1767">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-eq"></span>
</section>
<section id="eq" class="level4">
<h4 class="anchored" data-anchor-id="eq">eq</h4>
<ul>
<li><code>(eq _)</code></li>
<li><code>(eq a b)</code></li>
<li><code>(eq a b &amp; r)</code></li>
</ul>
<p>Primitive math equality function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L346">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-even?"></span>
</section>
<section id="even" class="level4">
<h4 class="anchored" data-anchor-id="even">even?</h4>
<ul>
<li><code>(even? x)</code></li>
</ul>
<p>Primitive and inlined <code>even?</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L314">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-excsc"></span>
</section>
<section id="excsc" class="level4">
<h4 class="anchored" data-anchor-id="excsc">excsc</h4>
<ul>
<li><code>(excsc x)</code></li>
</ul>
<p>Excosecant</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1011">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-exp"></span>
</section>
<section id="exp" class="level4">
<h4 class="anchored" data-anchor-id="exp">exp</h4>
<ul>
<li><code>(exp x)</code></li>
</ul>
<p>exp(x) = e^x</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1038">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-expexp"></span>
</section>
<section id="expexp" class="level4">
<h4 class="anchored" data-anchor-id="expexp">expexp</h4>
<ul>
<li><code>(expexp x)</code></li>
</ul>
<p>exp(-exp(-x))</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1236">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-expm1"></span>
</section>
<section id="expm1" class="level4">
<h4 class="anchored" data-anchor-id="expm1">expm1</h4>
<ul>
<li><code>(expm1 x)</code></li>
</ul>
<p>exp(x)-1 for small x</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1067">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-exsec"></span>
</section>
<section id="exsec" class="level4">
<h4 class="anchored" data-anchor-id="exsec">exsec</h4>
<ul>
<li><code>(exsec x)</code></li>
</ul>
<p>Exsecant</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1005">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-factorial"></span>
</section>
<section id="factorial" class="level4">
<h4 class="anchored" data-anchor-id="factorial">factorial</h4>
<ul>
<li><code>(factorial n)</code></li>
</ul>
<p>Factorial</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1377">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-factorial20"></span>
</section>
<section id="factorial20" class="level4">
<h4 class="anchored" data-anchor-id="factorial20">factorial20</h4>
<ul>
<li><code>(factorial20 n)</code></li>
</ul>
<p>Factorial table up to 20!</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1372">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-falling-factorial"></span>
</section>
<section id="falling-factorial" class="level4">
<h4 class="anchored" data-anchor-id="falling-factorial">falling-factorial</h4>
<ul>
<li><code>(falling-factorial n x)</code></li>
</ul>
<p>Falling (descending) factorial.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1405">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-falling-factorial-int"></span>
</section>
<section id="falling-factorial-int" class="level4">
<h4 class="anchored" data-anchor-id="falling-factorial-int">falling-factorial-int</h4>
<ul>
<li><code>(falling-factorial-int n x)</code></li>
</ul>
<p>Falling (descending) factorial for integer n.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1395">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-fast*"></span>
</section>
<section id="fast-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="fast-deprecated">fast* <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use <code>*</code> instead</em></p>
<ul>
<li><code>(fast*)</code></li>
<li><code>(fast* a)</code></li>
<li><code>(fast* a b)</code></li>
<li><code>(fast* a b &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>*</code> as a function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2312">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-fast+"></span>
</section>
<section id="fast-deprecated-1" class="level4">
<h4 class="anchored" data-anchor-id="fast-deprecated-1">fast+ <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use <code>+</code> instead</em></p>
<ul>
<li><code>(fast+)</code></li>
<li><code>(fast+ a)</code></li>
<li><code>(fast+ a b)</code></li>
<li><code>(fast+ a b &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>+</code> as a function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2292">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-fast-"></span>
</section>
<section id="fast--deprecated" class="level4">
<h4 class="anchored" data-anchor-id="fast--deprecated">fast- <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use <code>-</code> instead</em></p>
<ul>
<li><code>(fast-)</code></li>
<li><code>(fast- a)</code></li>
<li><code>(fast- a b)</code></li>
<li><code>(fast- a b &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>-</code> as a function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2302">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-fast-div"></span>
</section>
<section id="fast-div-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="fast-div-deprecated">fast-div <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use <code>/</code> instead</em></p>
<ul>
<li><code>(fast-div)</code></li>
<li><code>(fast-div a)</code></li>
<li><code>(fast-div a b)</code></li>
<li><code>(fast-div a b &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>/</code> as a function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2322">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-fast-identity"></span>
</section>
<section id="fast-identity-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="fast-identity-deprecated">fast-identity <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use <code>identity-double</code> instead</em></p>
<ul>
<li><code>(fast-identity a)</code></li>
</ul>
<p>Identity on double.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2350">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-fast-max"></span>
</section>
<section id="fast-max-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="fast-max-deprecated">fast-max <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use <code>max</code> instead</em></p>
<ul>
<li><code>(fast-max a)</code></li>
<li><code>(fast-max a b)</code></li>
<li><code>(fast-max a b &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>max</code> as a function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2332">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-fast-min"></span>
</section>
<section id="fast-min-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="fast-min-deprecated">fast-min <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use <code>min</code> instead</em></p>
<ul>
<li><code>(fast-min a)</code></li>
<li><code>(fast-min a b)</code></li>
<li><code>(fast-min a b &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>min</code> as a function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2341">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-floor"></span>
</section>
<section id="floor" class="level4">
<h4 class="anchored" data-anchor-id="floor">floor</h4>
<ul>
<li><code>(floor x)</code></li>
<li><code>(floor x scale)</code></li>
</ul>
<p><span class="math inline">\(\lfloor x \rfloor\)</span>. See: <a href="#LOS-qfloor">qfloor</a>.</p>
<p>Rounding is done to a multiply of scale value (when provided).</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1546">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-fma"></span>
</section>
<section id="fma-1" class="level4">
<h4 class="anchored" data-anchor-id="fma-1">fma</h4>
<ul>
<li><code>(fma x y z)</code></li>
</ul>
<p><code>(x y z)</code> -&gt; <code>(+ z (* x y))</code> or <code>Math/fma</code> for java 9+</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L614">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-fpow"></span>
</section>
<section id="fpow" class="level4">
<h4 class="anchored" data-anchor-id="fpow">fpow</h4>
<ul>
<li><code>(fpow x exponent)</code></li>
</ul>
<p>Fast version of pow where exponent is integer.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1361">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-frac"></span>
</section>
<section id="frac" class="level4">
<h4 class="anchored" data-anchor-id="frac">frac</h4>
<ul>
<li><code>(frac v)</code></li>
</ul>
<p>Fractional part, always returns values from 0.0 to 1.0 (exclusive). See <a href="#LOS-sfrac">sfrac</a> for signed version.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1673">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-gcd"></span>
</section>
<section id="gcd" class="level4">
<h4 class="anchored" data-anchor-id="gcd">gcd</h4>
<ul>
<li><code>(gcd a b)</code></li>
</ul>
<p>Fast binary greatest common divisor (Stein’s algorithm)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2138">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-group-by-intervals"></span>
</section>
<section id="group-by-intervals" class="level4">
<h4 class="anchored" data-anchor-id="group-by-intervals">group-by-intervals</h4>
<ul>
<li><code>(group-by-intervals coll)</code></li>
<li><code>(group-by-intervals intervals coll)</code></li>
</ul>
<p>Group sequence of values into given intervals.</p>
<p>If <code>intervals</code> are missing, use <a href="#LOS-co-intervals">co-intervals</a> to find some.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2113">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hacovercos"></span>
</section>
<section id="hacovercos" class="level4">
<h4 class="anchored" data-anchor-id="hacovercos">hacovercos</h4>
<ul>
<li><code>(hacovercos x)</code></li>
</ul>
<p>Hacovercosine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L975">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hacoversin"></span>
</section>
<section id="hacoversin" class="level4">
<h4 class="anchored" data-anchor-id="hacoversin">hacoversin</h4>
<ul>
<li><code>(hacoversin x)</code></li>
</ul>
<p>Hacoversine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L963">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-havercos"></span>
</section>
<section id="havercos" class="level4">
<h4 class="anchored" data-anchor-id="havercos">havercos</h4>
<ul>
<li><code>(havercos x)</code></li>
</ul>
<p>Havercosine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L969">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-haversin"></span>
</section>
<section id="haversin" class="level4">
<h4 class="anchored" data-anchor-id="haversin">haversin</h4>
<ul>
<li><code>(haversin x)</code></li>
<li><code>(haversin [lat1 lon1] [lat2 lon2])</code></li>
<li><code>(haversin lat1 lon1 lat2 lon2)</code></li>
</ul>
<p>Haversine formula for value or lattitude and longitude pairs.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L948">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-haversine"></span>
</section>
<section id="haversine" class="level4">
<h4 class="anchored" data-anchor-id="haversine">haversine</h4>
<p>Haversine (<a href="#LOS-haversin">haversin</a> alias)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L961">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-haversine-dist"></span>
</section>
<section id="haversine-dist" class="level4">
<h4 class="anchored" data-anchor-id="haversine-dist">haversine-dist</h4>
<ul>
<li><code>(haversine-dist [lat1 lon1] [lat2 lon2])</code></li>
<li><code>(haversine-dist lat1 lon1 lat2 lon2)</code></li>
</ul>
<p>Haversine distance <code>d</code> for <code>r=1</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1029">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-high-2-exp"></span>
</section>
<section id="high-2-exp" class="level4">
<h4 class="anchored" data-anchor-id="high-2-exp">high-2-exp</h4>
<ul>
<li><code>(high-2-exp x)</code></li>
</ul>
<p>Find lowest exponent (power of 2) which is greater or equal <code>x</code>. See <a href="#LOS-low-2-exp">low-2-exp</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1690">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-high-exp"></span>
</section>
<section id="high-exp" class="level4">
<h4 class="anchored" data-anchor-id="high-exp">high-exp</h4>
<ul>
<li><code>(high-exp b x)</code></li>
</ul>
<p>Find lowest exponent for base <code>b</code> which is higher or equal<code>x</code>. See also <a href="#LOS-low-exp">low-exp</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1698">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hypot"></span>
</section>
<section id="hypot" class="level4">
<h4 class="anchored" data-anchor-id="hypot">hypot</h4>
<ul>
<li><code>(hypot x y)</code></li>
<li><code>(hypot x y z)</code></li>
</ul>
<p>Hypot. See also <a href="#LOS-hypot-sqrt">hypot-sqrt</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1507">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hypot-sqrt"></span>
</section>
<section id="hypot-sqrt" class="level4">
<h4 class="anchored" data-anchor-id="hypot-sqrt">hypot-sqrt</h4>
<ul>
<li><code>(hypot-sqrt x y)</code></li>
<li><code>(hypot-sqrt x y z)</code></li>
</ul>
<p>Hypot, sqrt version: <span class="math inline">\(\sqrt{x^2+y^2}\)</span> or <span class="math inline">\(\sqrt{x^2+y^2+z^2}\)</span>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1518">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-iabs"></span>
</section>
<section id="iabs-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="iabs-deprecated">iabs <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use long-abs.</em></p>
<ul>
<li><code>(iabs x)</code></li>
</ul>
<p><span class="math inline">\(|x|\)</span> - <code>long</code> version. See <a href="#LOS-abs">abs</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1619">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-identity-double"></span>
</section>
<section id="identity-double" class="level4">
<h4 class="anchored" data-anchor-id="identity-double">identity-double</h4>
<ul>
<li><code>(identity-double a)</code></li>
</ul>
<p>Identity on double.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L572">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-identity-long"></span>
</section>
<section id="identity-long" class="level4">
<h4 class="anchored" data-anchor-id="identity-long">identity-long</h4>
<ul>
<li><code>(identity-long a)</code></li>
</ul>
<p>Identity on double.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L577">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-inc"></span>
</section>
<section id="inc" class="level4">
<h4 class="anchored" data-anchor-id="inc">inc</h4>
<ul>
<li><code>(inc x)</code></li>
</ul>
<p>Primitive and inlined <code>inc</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L174">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-inf?"></span>
</section>
<section id="inf" class="level4">
<h4 class="anchored" data-anchor-id="inf">inf?</h4>
<ul>
<li><code>(inf? v)</code></li>
</ul>
<p>Check if a number is an infinite (positive or negative).</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2027">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-integer?"></span>
</section>
<section id="integer" class="level4">
<h4 class="anchored" data-anchor-id="integer">integer?</h4>
<ul>
<li><code>(integer? v)</code></li>
</ul>
<p>Check if given real number is an integer.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L582">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-inv-factorial"></span>
</section>
<section id="inv-factorial" class="level4">
<h4 class="anchored" data-anchor-id="inv-factorial">inv-factorial</h4>
<ul>
<li><code>(inv-factorial n)</code></li>
</ul>
<p>Inverse of factorial, 1/n!</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1383">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-invalid-double?"></span>
</section>
<section id="invalid-double" class="level4">
<h4 class="anchored" data-anchor-id="invalid-double">invalid-double?</h4>
<ul>
<li><code>(invalid-double? v)</code></li>
</ul>
<p>Check if a number is not finite double (NaN or ±Inf).</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2045">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-itrunc"></span>
</section>
<section id="itrunc" class="level4">
<h4 class="anchored" data-anchor-id="itrunc">itrunc</h4>
<ul>
<li><code>(itrunc v)</code></li>
</ul>
<p>Truncate fractional part, keep sign. Returns <code>long</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1636">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-jvm-version"></span>
</section>
<section id="jvm-version-const" class="level4">
<h4 class="anchored" data-anchor-id="jvm-version-const">jvm-version <sup><sub>CONST</sub></sup></h4>
<p><code>jvm-version = 21</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L42">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-lcm"></span>
</section>
<section id="lcm" class="level4">
<h4 class="anchored" data-anchor-id="lcm">lcm</h4>
<ul>
<li><code>(lcm a b)</code></li>
</ul>
<p>Fast binary least common multiplier.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2143">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-lerp"></span>
</section>
<section id="lerp" class="level4">
<h4 class="anchored" data-anchor-id="lerp">lerp</h4>
<ul>
<li><code>(lerp start stop t)</code></li>
</ul>
<p>Linear interpolation between <code>start</code> and <code>stop</code> for amount <code>t</code>. See also <a href="#LOS-mlerp">mlerp</a>, <a href="#LOS-cos-interpolation">cos-interpolation</a>, <a href="#LOS-quad-interpolation">quad-interpolation</a> or <a href="#LOS-smooth-interpolation">smooth-interpolation</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1922">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ln"></span>
</section>
<section id="ln" class="level4">
<h4 class="anchored" data-anchor-id="ln">ln</h4>
<ul>
<li><code>(ln x)</code></li>
</ul>
<p>log(x)=ln(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1052">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log"></span>
</section>
<section id="log" class="level4">
<h4 class="anchored" data-anchor-id="log">log</h4>
<ul>
<li><code>(log x)</code></li>
<li><code>(log base x)</code></li>
</ul>
<p>log(x)=ln(x) or logarithm with given <code>base</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1044">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log-combinations"></span>
</section>
<section id="log-combinations" class="level4">
<h4 class="anchored" data-anchor-id="log-combinations">log-combinations</h4>
<ul>
<li><code>(log-combinations n k)</code></li>
</ul>
<p>Log of binomial coefficient (n choose k)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1447">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log-factorial"></span>
</section>
<section id="log-factorial" class="level4">
<h4 class="anchored" data-anchor-id="log-factorial">log-factorial</h4>
<ul>
<li><code>(log-factorial x)</code></li>
</ul>
<p>Log factorial, alias to log-gamma</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1389">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log10"></span>
</section>
<section id="log10" class="level4">
<h4 class="anchored" data-anchor-id="log10">log10</h4>
<ul>
<li><code>(log10 x)</code></li>
</ul>
<p>log_10(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1057">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log1mexp"></span>
</section>
<section id="log1mexp" class="level4">
<h4 class="anchored" data-anchor-id="log1mexp">log1mexp</h4>
<ul>
<li><code>(log1mexp x)</code></li>
</ul>
<p>log(1-exp(x)), x&lt;0</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1091">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log1p"></span>
</section>
<section id="log1p" class="level4">
<h4 class="anchored" data-anchor-id="log1p">log1p</h4>
<ul>
<li><code>(log1p x)</code></li>
</ul>
<p>log(1+x) for small x</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1062">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log1pexp"></span>
</section>
<section id="log1pexp" class="level4">
<h4 class="anchored" data-anchor-id="log1pexp">log1pexp</h4>
<ul>
<li><code>(log1pexp x)</code></li>
</ul>
<p>log(1+exp(x))</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1081">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log1pmx"></span>
</section>
<section id="log1pmx" class="level4">
<h4 class="anchored" data-anchor-id="log1pmx">log1pmx</h4>
<ul>
<li><code>(log1pmx x)</code></li>
</ul>
<p>log(1+x)-x</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1127">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log1psq"></span>
</section>
<section id="log1psq" class="level4">
<h4 class="anchored" data-anchor-id="log1psq">log1psq</h4>
<ul>
<li><code>(log1psq x)</code></li>
</ul>
<p>log(1+x^2))</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1105">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log2"></span>
</section>
<section id="log2" class="level4">
<h4 class="anchored" data-anchor-id="log2">log2</h4>
<ul>
<li><code>(log2 x)</code></li>
</ul>
<p>Logarithm with base 2.</p>
<p><span class="math inline">\(\ln_2{x}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1311">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log2int"></span>
</section>
<section id="log2int" class="level4">
<h4 class="anchored" data-anchor-id="log2int">log2int</h4>
<ul>
<li><code>(log2int v)</code></li>
</ul>
<p>Fast and integer version of log2, returns long</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1774">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-log2mexp"></span>
</section>
<section id="log2mexp" class="level4">
<h4 class="anchored" data-anchor-id="log2mexp">log2mexp</h4>
<ul>
<li><code>(log2mexp x)</code></li>
</ul>
<p>log(2-exp(x))</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1098">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-logaddexp"></span>
</section>
<section id="logaddexp" class="level4">
<h4 class="anchored" data-anchor-id="logaddexp">logaddexp</h4>
<ul>
<li><code>(logaddexp x y)</code></li>
</ul>
<p>log(exp(x)+exp(y))</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1153">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-logb"></span>
</section>
<section id="logb" class="level4">
<h4 class="anchored" data-anchor-id="logb">logb</h4>
<ul>
<li><code>(logb b x)</code></li>
</ul>
<p>Logarithm with base <code>b</code>.</p>
<p><span class="math inline">\(\ln_b{x}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1321">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-logcosh"></span>
</section>
<section id="logcosh" class="level4">
<h4 class="anchored" data-anchor-id="logcosh">logcosh</h4>
<ul>
<li><code>(logcosh x)</code></li>
</ul>
<p>log(cosh(x))</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1330">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-logexpm1"></span>
</section>
<section id="logexpm1" class="level4">
<h4 class="anchored" data-anchor-id="logexpm1">logexpm1</h4>
<ul>
<li><code>(logexpm1 x)</code></li>
</ul>
<p>log(exp(x)-1))</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1112">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-logistic"></span>
</section>
<section id="logistic" class="level4">
<h4 class="anchored" data-anchor-id="logistic">logistic</h4>
<p>Alias for <a href="#LOS-sigmoid">sigmoid</a></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1302">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-logit"></span>
</section>
<section id="logit" class="level4">
<h4 class="anchored" data-anchor-id="logit">logit</h4>
<ul>
<li><code>(logit x)</code></li>
</ul>
<p>Logit function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1304">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-loglog"></span>
</section>
<section id="loglog" class="level4">
<h4 class="anchored" data-anchor-id="loglog">loglog</h4>
<ul>
<li><code>(loglog x)</code></li>
</ul>
<p>-log(-log(x))</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1209">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-logmxp1"></span>
</section>
<section id="logmxp1" class="level4">
<h4 class="anchored" data-anchor-id="logmxp1">logmxp1</h4>
<ul>
<li><code>(logmxp1 x)</code></li>
</ul>
<p>log(x)-x+1</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1142">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-logsubexp"></span>
</section>
<section id="logsubexp" class="level4">
<h4 class="anchored" data-anchor-id="logsubexp">logsubexp</h4>
<ul>
<li><code>(logsubexp x y)</code></li>
</ul>
<p>log(abs(exp(x)-exp(y)))</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1161">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-logsumexp"></span>
</section>
<section id="logsumexp" class="level4">
<h4 class="anchored" data-anchor-id="logsumexp">logsumexp</h4>
<ul>
<li><code>(logsumexp xs)</code></li>
</ul>
<p>log(exp(x1)+…+exp(xn))</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1169">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-long-abs"></span>
</section>
<section id="long-abs" class="level4">
<h4 class="anchored" data-anchor-id="long-abs">long-abs</h4>
<ul>
<li><code>(long-abs x)</code></li>
</ul>
<p><span class="math inline">\(|x|\)</span> - <code>long</code> version. See <a href="#LOS-abs">abs</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1626">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-long-add"></span>
</section>
<section id="long-add" class="level4">
<h4 class="anchored" data-anchor-id="long-add">long-add</h4>
<ul>
<li><code>(long-add)</code></li>
<li><code>(long-add a)</code></li>
<li><code>(long-add a b)</code></li>
<li><code>(long-add a b c)</code></li>
<li><code>(long-add a b c d)</code></li>
<li><code>(long-add a b c d &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>+</code>. Coerces arguments and returned value to a long.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L94">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-long-dec"></span>
</section>
<section id="long-dec" class="level4">
<h4 class="anchored" data-anchor-id="long-dec">long-dec</h4>
<ul>
<li><code>(long-dec x)</code></li>
</ul>
<p>Primitive and inlined <code>dec</code> coerced to a long</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L192">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-long-div"></span>
</section>
<section id="long-div" class="level4">
<h4 class="anchored" data-anchor-id="long-div">long-div</h4>
<ul>
<li><code>(long-div a)</code></li>
<li><code>(long-div a b)</code></li>
<li><code>(long-div a b c)</code></li>
<li><code>(long-div a b c d)</code></li>
<li><code>(long-div a b c d &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>/</code>. Coerces to arguments and returned value to a long.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L163">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-long-inc"></span>
</section>
<section id="long-inc" class="level4">
<h4 class="anchored" data-anchor-id="long-inc">long-inc</h4>
<ul>
<li><code>(long-inc x)</code></li>
</ul>
<p>Primitive and inlined <code>inc</code> coerced to a long</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L180">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-long-max"></span>
</section>
<section id="long-max" class="level4">
<h4 class="anchored" data-anchor-id="long-max">long-max</h4>
<ul>
<li><code>(long-max a)</code></li>
<li><code>(long-max a b)</code></li>
<li><code>(long-max a b c)</code></li>
<li><code>(long-max a b c d)</code></li>
<li><code>(long-max a b c d &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>max</code>. Coerces arguments and returned values to longs.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L267">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-long-min"></span>
</section>
<section id="long-min" class="level4">
<h4 class="anchored" data-anchor-id="long-min">long-min</h4>
<ul>
<li><code>(long-min a)</code></li>
<li><code>(long-min a b)</code></li>
<li><code>(long-min a b c)</code></li>
<li><code>(long-min a b c d)</code></li>
<li><code>(long-min a b c d &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>min</code>. Coerces arguments and returned values to longs.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L245">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-long-mod"></span>
</section>
<section id="long-mod" class="level4">
<h4 class="anchored" data-anchor-id="long-mod">long-mod</h4>
<ul>
<li><code>(long-mod x y)</code></li>
</ul>
<p>Primitive and inlined <code>mod</code> coerced to longs</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L228">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-long-mult"></span>
</section>
<section id="long-mult" class="level4">
<h4 class="anchored" data-anchor-id="long-mult">long-mult</h4>
<ul>
<li><code>(long-mult)</code></li>
<li><code>(long-mult a)</code></li>
<li><code>(long-mult a b)</code></li>
<li><code>(long-mult a b c)</code></li>
<li><code>(long-mult a b c d)</code></li>
<li><code>(long-mult a b c d &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>*</code>. Coerces arguments and returned value to a long.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L140">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-long-quot"></span>
</section>
<section id="long-quot" class="level4">
<h4 class="anchored" data-anchor-id="long-quot">long-quot</h4>
<ul>
<li><code>(long-quot x y)</code></li>
</ul>
<p>Primitive and inlined <code>quot</code> coerced to longs</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L216">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-long-rem"></span>
</section>
<section id="long-rem" class="level4">
<h4 class="anchored" data-anchor-id="long-rem">long-rem</h4>
<ul>
<li><code>(long-rem x y)</code></li>
</ul>
<p>Primitive and inlined <code>rem</code> coerced to longs</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L204">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-long-sub"></span>
</section>
<section id="long-sub" class="level4">
<h4 class="anchored" data-anchor-id="long-sub">long-sub</h4>
<ul>
<li><code>(long-sub a)</code></li>
<li><code>(long-sub a b)</code></li>
<li><code>(long-sub a b c)</code></li>
<li><code>(long-sub a b c d)</code></li>
<li><code>(long-sub a b c d &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>-</code>. Coerces arguments and returned value to a long.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L117">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-low-2-exp"></span>
</section>
<section id="low-2-exp" class="level4">
<h4 class="anchored" data-anchor-id="low-2-exp">low-2-exp</h4>
<ul>
<li><code>(low-2-exp x)</code></li>
</ul>
<p>Find greatest exponent (power of 2) which is lower or equal <code>x</code>. See <a href="#LOS-high-2-exp">high-2-exp</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1686">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-low-exp"></span>
</section>
<section id="low-exp" class="level4">
<h4 class="anchored" data-anchor-id="low-exp">low-exp</h4>
<ul>
<li><code>(low-exp b x)</code></li>
</ul>
<p>Find greatest exponent for base <code>b</code> which is lower or equal <code>x</code>. See also <a href="#LOS-high-exp">high-exp</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1694">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-make-norm"></span>
</section>
<section id="make-norm" class="level4">
<h4 class="anchored" data-anchor-id="make-norm">make-norm</h4>
<ul>
<li><code>(make-norm start stop)</code></li>
<li><code>(make-norm start stop dstart dstop)</code></li>
</ul>
<p>Make <a href="#LOS-norm">norm</a> function for given range. Resulting function accepts <code>double</code> value (with optional target <code>[dstart,dstop]</code> range) and returns <code>double</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1893">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-max"></span>
</section>
<section id="max" class="level4">
<h4 class="anchored" data-anchor-id="max">max</h4>
<ul>
<li><code>(max a)</code></li>
<li><code>(max a b)</code></li>
<li><code>(max a b c)</code></li>
<li><code>(max a b c d)</code></li>
<li><code>(max a b c d &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>max</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L256">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-min"></span>
</section>
<section id="min" class="level4">
<h4 class="anchored" data-anchor-id="min">min</h4>
<ul>
<li><code>(min a)</code></li>
<li><code>(min a b)</code></li>
<li><code>(min a b c)</code></li>
<li><code>(min a b c d)</code></li>
<li><code>(min a b c d &amp; r)</code></li>
</ul>
<p>Primitive and inlined <code>min</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L234">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-mlerp"></span>
</section>
<section id="mlerp-macro" class="level4">
<h4 class="anchored" data-anchor-id="mlerp-macro">mlerp <sup><sub>MACRO</sub></sup></h4>
<ul>
<li><code>(mlerp start stop t)</code></li>
</ul>
<p><a href="#LOS-lerp">lerp</a> as macro. For inline code. See also <a href="#LOS-lerp">lerp</a>, <a href="#LOS-cos-interpolation">cos-interpolation</a>, <a href="#LOS-quad-interpolation">quad-interpolation</a> or <a href="#LOS-smooth-interpolation">smooth-interpolation</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1930">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-mnorm"></span>
</section>
<section id="mnorm-macro" class="level4">
<h4 class="anchored" data-anchor-id="mnorm-macro">mnorm <sup><sub>MACRO</sub></sup></h4>
<ul>
<li><code>(mnorm v start stop)</code></li>
<li><code>(mnorm v start1 stop1 start2 stop2)</code></li>
</ul>
<p>Macro version of <a href="#LOS-norm">norm</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1886">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-mod"></span>
</section>
<section id="mod" class="level4">
<h4 class="anchored" data-anchor-id="mod">mod</h4>
<ul>
<li><code>(mod x y)</code></li>
</ul>
<p>Primitive and inlined <code>mod</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L222">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-muladd"></span>
</section>
<section id="muladd" class="level4">
<h4 class="anchored" data-anchor-id="muladd">muladd</h4>
<ul>
<li><code>(muladd x y z)</code></li>
</ul>
<p><code>(x y z)</code> -&gt; <code>(+ z (* x y))</code> or <code>Math/fma</code> for java 9+</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L607">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-nan?"></span>
</section>
<section id="nan" class="level4">
<h4 class="anchored" data-anchor-id="nan">nan?</h4>
<ul>
<li><code>(nan? v)</code></li>
</ul>
<p>Check if a number is a NaN</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2021">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-near-zero?"></span>
</section>
<section id="near-zero" class="level4">
<h4 class="anchored" data-anchor-id="near-zero">near-zero?</h4>
<ul>
<li><code>(near-zero? x)</code></li>
<li><code>(near-zero? x abs-tol)</code></li>
<li><code>(near-zero? x abs-tol rel-tol)</code></li>
</ul>
<p>Checks if given value is near zero with absolute (default: <code>1.0e-6</code>) and/or relative (default <code>0.0</code>) tolerance.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1666">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-neg-inf?"></span>
</section>
<section id="neg-inf" class="level4">
<h4 class="anchored" data-anchor-id="neg-inf">neg-inf?</h4>
<ul>
<li><code>(neg-inf? v)</code></li>
</ul>
<p>Check if a number is negatively infinite.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2039">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-neg?"></span>
</section>
<section id="neg" class="level4">
<h4 class="anchored" data-anchor-id="neg">neg?</h4>
<ul>
<li><code>(neg? x)</code></li>
</ul>
<p>Primitive and inlined <code>neg?</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L290">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-negative-zero?"></span>
</section>
<section id="negative-zero" class="level4">
<h4 class="anchored" data-anchor-id="negative-zero">negative-zero?</h4>
<ul>
<li><code>(negative-zero? x)</code></li>
</ul>
<p>Check if zero is negative, ie. -0.0</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L564">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-negmuladd"></span>
</section>
<section id="negmuladd" class="level4">
<h4 class="anchored" data-anchor-id="negmuladd">negmuladd</h4>
<ul>
<li><code>(negmuladd x y z)</code></li>
</ul>
<p><code>(x y z)</code> -&gt; <code>(+ z (* -x y))</code> or <code>Math/fma</code> for java 9+</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L621">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-next-double"></span>
</section>
<section id="next-double" class="level4">
<h4 class="anchored" data-anchor-id="next-double">next-double</h4>
<ul>
<li><code>(next-double v)</code></li>
<li><code>(next-double v delta)</code></li>
</ul>
<p>Next double value. Optional value <code>delta</code> sets step amount.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1714">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-norm"></span>
</section>
<section id="norm" class="level4">
<h4 class="anchored" data-anchor-id="norm">norm</h4>
<ul>
<li><code>(norm v start stop)</code></li>
<li><code>(norm v start1 stop1 start2 stop2)</code></li>
</ul>
<p>Normalize <code>v</code> from the range <code>[start,stop]</code> to the range <code>[0,1]</code> or map <code>v</code> from the range <code>[start1,stop1]</code> to the range <code>[start2,stop2]</code>. See also <a href="#LOS-make-norm">make-norm</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1873">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-not-neg?"></span>
</section>
<section id="not-neg" class="level4">
<h4 class="anchored" data-anchor-id="not-neg">not-neg?</h4>
<ul>
<li><code>(not-neg? x)</code></li>
</ul>
<p>Primitive and inlined <code>not-neg?</code> (x&gt;=0.0)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L302">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-not-pos?"></span>
</section>
<section id="not-pos" class="level4">
<h4 class="anchored" data-anchor-id="not-pos">not-pos?</h4>
<ul>
<li><code>(not-pos? x)</code></li>
</ul>
<p>Primitive and inlined <code>not-pos?</code> (x&lt;=0.0)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L308">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-not=="></span>
</section>
<section id="not" class="level4">
<h4 class="anchored" data-anchor-id="not">not==</h4>
<ul>
<li><code>(not== _)</code></li>
<li><code>(not== a b)</code></li>
<li><code>(not== a b &amp; r)</code></li>
</ul>
<p>Not equality. For more than two arguments, pairwise not equality is checked.</p>
<p><code>(not== 1 2 1)</code> === <code>(and (not= 1 2) (not= 2 1))</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L401">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-odd?"></span>
</section>
<section id="odd" class="level4">
<h4 class="anchored" data-anchor-id="odd">odd?</h4>
<ul>
<li><code>(odd? x)</code></li>
</ul>
<p>Primitive and inlined <code>odd?</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L320">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-one?"></span>
</section>
<section id="one" class="level4">
<h4 class="anchored" data-anchor-id="one">one?</h4>
<ul>
<li><code>(one? x)</code></li>
</ul>
<p>Primitive and inlined <code>one?</code> (x==1.0)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L284">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-order"></span>
</section>
<section id="order" class="level4">
<h4 class="anchored" data-anchor-id="order">order</h4>
<ul>
<li><code>(order vs)</code></li>
<li><code>(order vs decreasing?)</code></li>
</ul>
<p>Ordering permutation. See <a href="https://www.rdocumentation.org/packages/base/versions/3.6.1/topics/order">R docs</a></p>
<p>Order uses 0 based indexing.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2213">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-pos-inf?"></span>
</section>
<section id="pos-inf" class="level4">
<h4 class="anchored" data-anchor-id="pos-inf">pos-inf?</h4>
<ul>
<li><code>(pos-inf? v)</code></li>
</ul>
<p>Check if a number is positively infinite.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2033">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-pos?"></span>
</section>
<section id="pos" class="level4">
<h4 class="anchored" data-anchor-id="pos">pos?</h4>
<ul>
<li><code>(pos? x)</code></li>
</ul>
<p>Primitive and inlined <code>pos?</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L296">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-pow"></span>
</section>
<section id="pow" class="level4">
<h4 class="anchored" data-anchor-id="pow">pow</h4>
<ul>
<li><code>(pow x exponent)</code></li>
</ul>
<p>Power of a number</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1349">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-pow2"></span>
</section>
<section id="pow2" class="level4">
<h4 class="anchored" data-anchor-id="pow2">pow2</h4>
<ul>
<li><code>(pow2 x)</code></li>
</ul>
<p>Same as <a href="#LOS-sq">sq</a>. <span class="math inline">\(x^2\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1466">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-pow3"></span>
</section>
<section id="pow3" class="level4">
<h4 class="anchored" data-anchor-id="pow3">pow3</h4>
<ul>
<li><code>(pow3 x)</code></li>
</ul>
<p><span class="math inline">\(x^3\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1471">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-prev-double"></span>
</section>
<section id="prev-double" class="level4">
<h4 class="anchored" data-anchor-id="prev-double">prev-double</h4>
<ul>
<li><code>(prev-double v)</code></li>
<li><code>(prev-double v delta)</code></li>
</ul>
<p>Next double value. Optional value <code>delta</code> sets step amount.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1723">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-qceil"></span>
</section>
<section id="qceil" class="level4">
<h4 class="anchored" data-anchor-id="qceil">qceil</h4>
<ul>
<li><code>(qceil x)</code></li>
</ul>
<p>Fast version of <a href="#LOS-ceil">ceil</a>. Returns <code>long</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1593">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-qcos"></span>
</section>
<section id="qcos" class="level4">
<h4 class="anchored" data-anchor-id="qcos">qcos</h4>
<ul>
<li><code>(qcos x)</code></li>
</ul>
<p>Fast and less accurate cos(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L778">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-qdist"></span>
</section>
<section id="qdist" class="level4">
<h4 class="anchored" data-anchor-id="qdist">qdist</h4>
<ul>
<li><code>(qdist [x1 y1] [x2 y2])</code></li>
<li><code>(qdist x1 y1 x2 y2)</code></li>
</ul>
<p>Quick version of Euclidean distance between points. <a href="#LOS-qsqrt">qsqrt</a> is used instead of <a href="#LOS-sqrt">sqrt</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1537">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-qexp"></span>
</section>
<section id="qexp" class="level4">
<h4 class="anchored" data-anchor-id="qexp">qexp</h4>
<ul>
<li><code>(qexp x)</code></li>
</ul>
<p>Quick and less accurate version of <a href="#LOS-exp">exp</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1264">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-qfloor"></span>
</section>
<section id="qfloor" class="level4">
<h4 class="anchored" data-anchor-id="qfloor">qfloor</h4>
<ul>
<li><code>(qfloor x)</code></li>
</ul>
<p>Fast version of <a href="#LOS-floor">floor</a>. Returns <code>long</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1587">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-qlog"></span>
</section>
<section id="qlog" class="level4">
<h4 class="anchored" data-anchor-id="qlog">qlog</h4>
<ul>
<li><code>(qlog x)</code></li>
</ul>
<p>Fast and less accurate version of <a href="#LOS-log">log</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1244">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-qpow"></span>
</section>
<section id="qpow" class="level4">
<h4 class="anchored" data-anchor-id="qpow">qpow</h4>
<ul>
<li><code>(qpow x exponent)</code></li>
</ul>
<p>Fast and less accurate version of <a href="#LOS-pow">pow</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1355">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-qround"></span>
</section>
<section id="qround" class="level4">
<h4 class="anchored" data-anchor-id="qround">qround</h4>
<ul>
<li><code>(qround x)</code></li>
</ul>
<p>Fast version of <a href="#LOS-round">round</a>. Returns <code>long</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1599">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-qsin"></span>
</section>
<section id="qsin" class="level4">
<h4 class="anchored" data-anchor-id="qsin">qsin</h4>
<ul>
<li><code>(qsin x)</code></li>
</ul>
<p>Fast and less accurate sin(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L772">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-qsqrt"></span>
</section>
<section id="qsqrt" class="level4">
<h4 class="anchored" data-anchor-id="qsqrt">qsqrt</h4>
<ul>
<li><code>(qsqrt x)</code></li>
</ul>
<p>Approximated <a href="#LOS-sqrt">sqrt</a> using binary operations with error <code>1.0E-2</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1495">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-quad-interpolation"></span>
</section>
<section id="quad-interpolation" class="level4">
<h4 class="anchored" data-anchor-id="quad-interpolation">quad-interpolation</h4>
<ul>
<li><code>(quad-interpolation start stop t)</code></li>
</ul>
<p>Quad interpolation. See also <a href="#LOS-lerp">lerp</a>/<a href="#LOS-mlerp">mlerp</a>, <a href="#LOS-cos-interpolation">cos-interpolation</a> or <a href="#LOS-smooth-interpolation">smooth-interpolation</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1946">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-quot"></span>
</section>
<section id="quot" class="level4">
<h4 class="anchored" data-anchor-id="quot">quot</h4>
<ul>
<li><code>(quot x y)</code></li>
</ul>
<p>Primitive and inlined <code>quot</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L210">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rad-in-deg"></span>
</section>
<section id="rad-in-deg-const" class="level4">
<h4 class="anchored" data-anchor-id="rad-in-deg-const">rad-in-deg <sup><sub>CONST</sub></sup></h4>
<p><code>rad-in-deg = 57.29577951308232</code></p>
<p><span class="math inline">\(\frac{180}{\pi}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1271">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-radians"></span>
</section>
<section id="radians" class="level4">
<h4 class="anchored" data-anchor-id="radians">radians</h4>
<ul>
<li><code>(radians deg)</code></li>
</ul>
<p>Convert degrees into radians.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1274">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rank"></span>
</section>
<section id="rank" class="level4">
<h4 class="anchored" data-anchor-id="rank">rank</h4>
<ul>
<li><code>(rank vs)</code></li>
<li><code>(rank vs ties)</code></li>
<li><code>(rank vs ties desc?)</code></li>
</ul>
<p>Sample ranks. See <a href="https://www.rdocumentation.org/packages/base/versions/3.6.1/topics/rank">R docs</a>.</p>
<p>Rank uses 0 based indexing.</p>
<p>Possible tie strategies: <code>:average</code>, <code>:first</code>, <code>:last</code>, <code>:random</code>, <code>:min</code>, <code>:max</code>, <code>:dense</code>.</p>
<p><code>:dense</code> is the same as in <code>data.table::frank</code> from R</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2175">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rank1"></span>
</section>
<section id="rank1" class="level4">
<h4 class="anchored" data-anchor-id="rank1">rank1</h4>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2210">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rem"></span>
</section>
<section id="rem" class="level4">
<h4 class="anchored" data-anchor-id="rem">rem</h4>
<ul>
<li><code>(rem x y)</code></li>
</ul>
<p>Primitive and inlined <code>rem</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L198">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-remainder"></span>
</section>
<section id="remainder" class="level4">
<h4 class="anchored" data-anchor-id="remainder">remainder</h4>
<ul>
<li><code>(remainder dividend divisor)</code></li>
</ul>
<p>From <code>FastMath</code> doc: returns dividend - divisor * n, where n is the mathematical integer closest to dividend/divisor. Returned value in <code>[-|divisor|/2,|divisor|/2]</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1605">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rint"></span>
</section>
<section id="rint" class="level4">
<h4 class="anchored" data-anchor-id="rint">rint</h4>
<ul>
<li><code>(rint x)</code></li>
<li><code>(rint x scale)</code></li>
</ul>
<p>Round to <code>double</code>. See <a href="#LOS-round">round</a>, <a href="#LOS-qround">qround</a>.</p>
<p>Rounding is done to a multiply of scale value (when provided).</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1571">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rising-factorial"></span>
</section>
<section id="rising-factorial" class="level4">
<h4 class="anchored" data-anchor-id="rising-factorial">rising-factorial</h4>
<ul>
<li><code>(rising-factorial n x)</code></li>
</ul>
<p>Rising (Pochhammer) factorial.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1424">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rising-factorial-int"></span>
</section>
<section id="rising-factorial-int" class="level4">
<h4 class="anchored" data-anchor-id="rising-factorial-int">rising-factorial-int</h4>
<ul>
<li><code>(rising-factorial-int n x)</code></li>
</ul>
<p>Rising (Pochhammer) factorial for integer n.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1414">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-round"></span>
</section>
<section id="round" class="level4">
<h4 class="anchored" data-anchor-id="round">round</h4>
<ul>
<li><code>(round x)</code></li>
</ul>
<p>Round to <code>long</code>. See: <a href="#LOS-rint">rint</a>, <a href="#LOS-qround">qround</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1566">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-round-even"></span>
</section>
<section id="round-even" class="level4">
<h4 class="anchored" data-anchor-id="round-even">round-even</h4>
<ul>
<li><code>(round-even x)</code></li>
</ul>
<p>Round evenly (like in round in R), IEEE / IEC rounding</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1581">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-round-up-pow2"></span>
</section>
<section id="round-up-pow2" class="level4">
<h4 class="anchored" data-anchor-id="round-up-pow2">round-up-pow2</h4>
<ul>
<li><code>(round-up-pow2 v)</code></li>
</ul>
<p>Round long to the next power of 2</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1702">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rqsqrt"></span>
</section>
<section id="rqsqrt" class="level4">
<h4 class="anchored" data-anchor-id="rqsqrt">rqsqrt</h4>
<ul>
<li><code>(rqsqrt x)</code></li>
</ul>
<p>Reciprocal of <a href="#LOS-qsqrt">qsqrt</a>. Quick and less accurate.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1501">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-safe-sqrt"></span>
</section>
<section id="safe-sqrt" class="level4">
<h4 class="anchored" data-anchor-id="safe-sqrt">safe-sqrt</h4>
<ul>
<li><code>(safe-sqrt value)</code></li>
</ul>
<p>Safe sqrt, for value &lt;= 0 result is 0.</p>
$ \{
<span class="math display">\[\begin{array}{lr}
  0 &amp; : x \leq 0\\\\
  \sqrt{x} &amp; : x &gt; 0
  \end{array}\]</span>
<p>\right. $</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1481">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sample"></span>
</section>
<section id="sample" class="level4">
<h4 class="anchored" data-anchor-id="sample">sample</h4>
<ul>
<li><code>(sample f number-of-values)</code></li>
<li><code>(sample f number-of-values domain?)</code></li>
<li><code>(sample f domain-min domain-max number-of-values)</code></li>
<li><code>(sample f domain-min domain-max number-of-values domain?)</code></li>
</ul>
<p>Sample function <code>f</code> and return sequence of values.</p>
<p><code>range-min</code> defaults to 0.0, <code>range-max</code> to 1.0.</p>
<p>Range is inclusive.</p>
<p>When optional <code>domain?</code> is set to true (default: false) function returns pairs <code>[x,(f x)]</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2152">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sec"></span>
</section>
<section id="sec" class="level4">
<h4 class="anchored" data-anchor-id="sec">sec</h4>
<ul>
<li><code>(sec x)</code></li>
</ul>
<p>sec(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L798">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sech"></span>
</section>
<section id="sech" class="level4">
<h4 class="anchored" data-anchor-id="sech">sech</h4>
<ul>
<li><code>(sech x)</code></li>
</ul>
<p>Hyperbolic secant</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L855">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-secpi"></span>
</section>
<section id="secpi" class="level4">
<h4 class="anchored" data-anchor-id="secpi">secpi</h4>
<ul>
<li><code>(secpi x)</code></li>
</ul>
<p>sec(pi*x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L804">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-seq->double-array"></span>
</section>
<section id="seq-double-array" class="level4">
<h4 class="anchored" data-anchor-id="seq-double-array">seq-&gt;double-array</h4>
<ul>
<li><code>(seq-&gt;double-array vs)</code></li>
</ul>
<p>Convert sequence to double array. Returns input if <code>vs</code> is double array already.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2234">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-seq->double-double-array"></span>
</section>
<section id="seq-double-double-array" class="level4">
<h4 class="anchored" data-anchor-id="seq-double-double-array">seq-&gt;double-double-array</h4>
<ul>
<li><code>(seq-&gt;double-double-array vss)</code></li>
</ul>
<p>Convert sequence to double-array of double-arrays.</p>
<p>If sequence is double-array of double-arrays returns <code>vss</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2250">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sfrac"></span>
</section>
<section id="sfrac" class="level4">
<h4 class="anchored" data-anchor-id="sfrac">sfrac</h4>
<ul>
<li><code>(sfrac v)</code></li>
</ul>
<p>Fractional part, always returns values from -1.0 to 1.0 (exclusive). See <a href="#LOS-frac">frac</a> for unsigned version.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1677">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sgn"></span>
</section>
<section id="sgn" class="level4">
<h4 class="anchored" data-anchor-id="sgn">sgn</h4>
<ul>
<li><code>(sgn value)</code></li>
</ul>
<p>Return -1 when <code>value</code> is negative, 1 otherwise. See also <a href="#LOS-signum">signum</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1852">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sigmoid"></span>
</section>
<section id="sigmoid" class="level4">
<h4 class="anchored" data-anchor-id="sigmoid">sigmoid</h4>
<ul>
<li><code>(sigmoid x)</code></li>
</ul>
<p>Sigmoid function</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1295">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-signum"></span>
</section>
<section id="signum" class="level4">
<h4 class="anchored" data-anchor-id="signum">signum</h4>
<ul>
<li><code>(signum value)</code></li>
</ul>
<p>Return 1 if <code>value</code> is &gt; 0, 0 if it is 0, -1 otherwise. See also <a href="#LOS-sgn">sgn</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1843">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sin"></span>
</section>
<section id="sin" class="level4">
<h4 class="anchored" data-anchor-id="sin">sin</h4>
<ul>
<li><code>(sin x)</code></li>
</ul>
<p>sin(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L682">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sinc"></span>
</section>
<section id="sinc" class="level4">
<h4 class="anchored" data-anchor-id="sinc">sinc</h4>
<ul>
<li><code>(sinc v)</code></li>
</ul>
<p>Sinc function.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1287">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sinh"></span>
</section>
<section id="sinh" class="level4">
<h4 class="anchored" data-anchor-id="sinh">sinh</h4>
<ul>
<li><code>(sinh x)</code></li>
</ul>
<p>sinh(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L736">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sinpi"></span>
</section>
<section id="sinpi" class="level4">
<h4 class="anchored" data-anchor-id="sinpi">sinpi</h4>
<ul>
<li><code>(sinpi x)</code></li>
</ul>
<p>sin(pi*x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L688">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-slice-range"></span>
</section>
<section id="slice-range" class="level4">
<h4 class="anchored" data-anchor-id="slice-range">slice-range</h4>
<ul>
<li><code>(slice-range start end cnt)</code></li>
<li><code>(slice-range cnt)</code></li>
</ul>
<p>Slice range to get <code>cnt</code> number of points evenly distanced.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2074">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-smooth-interpolation"></span>
</section>
<section id="smooth-interpolation" class="level4">
<h4 class="anchored" data-anchor-id="smooth-interpolation">smooth-interpolation</h4>
<ul>
<li><code>(smooth-interpolation start stop t)</code></li>
</ul>
<p>Smoothstep based interpolation. See also <a href="#LOS-lerp">lerp</a>/<a href="#LOS-mlerp">mlerp</a>, <a href="#LOS-quad-interpolation">quad-interpolation</a> or <a href="#LOS-cos-interpolation">cos-interpolation</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1941">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-smooth-max"></span>
</section>
<section id="smooth-max" class="level4">
<h4 class="anchored" data-anchor-id="smooth-max">smooth-max</h4>
<ul>
<li><code>(smooth-max xs)</code></li>
<li><code>(smooth-max xs alpha)</code></li>
<li><code>(smooth-max xs alpha family)</code></li>
</ul>
<p>Smooth maximum function.</p>
<p>A smooth function with <code>alpha</code> argument. When <code>alpha</code> goes to infinity, function returns maximum value of <code>xs</code>.</p>
<p>Family:</p>
<ul>
<li><code>:lse</code> - LogSumExp (default)</li>
<li><code>:boltzmann</code> - Boltzmann operator, works for small alpha values</li>
<li><code>:mellowmax</code></li>
<li><code>:p-norm</code></li>
<li><code>:smu</code> - smooth maximum unit, epsilon = 1/alpha &gt; 0</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1992">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-smoothstep"></span>
</section>
<section id="smoothstep" class="level4">
<h4 class="anchored" data-anchor-id="smoothstep">smoothstep</h4>
<ul>
<li><code>(smoothstep edge0 edge1 x)</code></li>
</ul>
<p>GL <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/smoothstep.xhtml">smoothstep</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1954">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sq"></span>
</section>
<section id="sq" class="level4">
<h4 class="anchored" data-anchor-id="sq">sq</h4>
<ul>
<li><code>(sq x)</code></li>
</ul>
<p>Same as <a href="#LOS-pow2">pow2</a>. <span class="math inline">\(x^2\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1461">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sqrt"></span>
</section>
<section id="sqrt" class="level4">
<h4 class="anchored" data-anchor-id="sqrt">sqrt</h4>
<ul>
<li><code>(sqrt x)</code></li>
</ul>
<p><span class="math inline">\(\sqrt{x}\)</span></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1251">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sum-of-products"></span>
</section>
<section id="sum-of-products" class="level4">
<h4 class="anchored" data-anchor-id="sum-of-products">sum-of-products</h4>
<ul>
<li><code>(sum-of-products a b c d)</code></li>
</ul>
<p>Kahan’s algorithm for (a<em>b)+(c</em>d) to avoid catastrophic cancellation.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L635">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-tan"></span>
</section>
<section id="tan" class="level4">
<h4 class="anchored" data-anchor-id="tan">tan</h4>
<ul>
<li><code>(tan x)</code></li>
</ul>
<p>tan(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L706">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-tanh"></span>
</section>
<section id="tanh" class="level4">
<h4 class="anchored" data-anchor-id="tanh">tanh</h4>
<ul>
<li><code>(tanh x)</code></li>
</ul>
<p>tanh(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L748">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-tanpi"></span>
</section>
<section id="tanpi" class="level4">
<h4 class="anchored" data-anchor-id="tanpi">tanpi</h4>
<ul>
<li><code>(tanpi x)</code></li>
</ul>
<p>tan(pi*x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L712">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-trunc"></span>
</section>
<section id="trunc" class="level4">
<h4 class="anchored" data-anchor-id="trunc">trunc</h4>
<ul>
<li><code>(trunc v)</code></li>
</ul>
<p>Truncate fractional part, keep sign. Returns <code>double</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1632">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ulp"></span>
</section>
<section id="ulp" class="level4">
<h4 class="anchored" data-anchor-id="ulp">ulp</h4>
<ul>
<li><code>(ulp x)</code></li>
</ul>
<p>Unit in the Last Place, distance between next value larger than <code>x</code> and <code>x</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1784">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-unsigned-bit-shift-right"></span>
</section>
<section id="unsigned-bit-shift-right" class="level4">
<h4 class="anchored" data-anchor-id="unsigned-bit-shift-right">unsigned-bit-shift-right</h4>
<ul>
<li><code>(unsigned-bit-shift-right x shift)</code></li>
</ul>
<p>Shift bits right and set most significant bit to <code>0</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L530">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-unuse-primitive-operators"></span>
</section>
<section id="unuse-primitive-operators" class="level4">
<h4 class="anchored" data-anchor-id="unuse-primitive-operators">unuse-primitive-operators</h4>
<ul>
<li><code>(unuse-primitive-operators)</code></li>
<li><code>(unuse-primitive-operators skip-set)</code></li>
</ul>
<p>Undoes the work of <a href="#LOS-use-primitive-operators">use-primitive-operators</a>. This is idempotent.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2281">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-use-primitive-operators"></span>
</section>
<section id="use-primitive-operators" class="level4">
<h4 class="anchored" data-anchor-id="use-primitive-operators">use-primitive-operators</h4>
<ul>
<li><code>(use-primitive-operators)</code></li>
<li><code>(use-primitive-operators skip-set)</code></li>
</ul>
<p>Replaces Clojure’s arithmetic and number coercion functions with primitive equivalents. These are defined as macros, so they cannot be used as higher-order functions. This is an idempotent operation. Undo with <a href="#LOS-unuse-primitive-operators">unuse-primitive-operators</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2270">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-valid-double?"></span>
</section>
<section id="valid-double" class="level4">
<h4 class="anchored" data-anchor-id="valid-double">valid-double?</h4>
<ul>
<li><code>(valid-double? v)</code></li>
</ul>
<p>Check if a number is finite double.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L2051">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-vercos"></span>
</section>
<section id="vercos" class="level4">
<h4 class="anchored" data-anchor-id="vercos">vercos</h4>
<ul>
<li><code>(vercos x)</code></li>
</ul>
<p>Vercosine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L912">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-versin"></span>
</section>
<section id="versin" class="level4">
<h4 class="anchored" data-anchor-id="versin">versin</h4>
<ul>
<li><code>(versin x)</code></li>
</ul>
<p>Versine</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L900">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-wrap"></span>
</section>
<section id="wrap" class="level4">
<h4 class="anchored" data-anchor-id="wrap">wrap</h4>
<ul>
<li><code>(wrap [start stop] value)</code></li>
<li><code>(wrap start stop value)</code></li>
</ul>
<p>Wrap overflowed value into the range, similar to <a href="http://openframeworks.cc/documentation/math/ofMath/#!show_ofWrap">ofWrap</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1963">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-xexpx"></span>
</section>
<section id="xexpx" class="level4">
<h4 class="anchored" data-anchor-id="xexpx">xexpx</h4>
<ul>
<li><code>(xexpx x)</code></li>
</ul>
<p>x * exp(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1216">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-xexpy"></span>
</section>
<section id="xexpy" class="level4">
<h4 class="anchored" data-anchor-id="xexpy">xexpy</h4>
<ul>
<li><code>(xexpy x y)</code></li>
</ul>
<p>x * exp(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1222">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-xlog1py"></span>
</section>
<section id="xlog1py" class="level4">
<h4 class="anchored" data-anchor-id="xlog1py">xlog1py</h4>
<ul>
<li><code>(xlog1py x y)</code></li>
</ul>
<p>x * log(1+y)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1196">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-xlogx"></span>
</section>
<section id="xlogx" class="level4">
<h4 class="anchored" data-anchor-id="xlogx">xlogx</h4>
<ul>
<li><code>(xlogx x)</code></li>
</ul>
<p>x * log(x)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1185">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-xlogy"></span>
</section>
<section id="xlogy" class="level4">
<h4 class="anchored" data-anchor-id="xlogy">xlogy</h4>
<ul>
<li><code>(xlogy x y)</code></li>
</ul>
<p>x * log(y)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L1190">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-xor"></span>
</section>
<section id="xor" class="level4">
<h4 class="anchored" data-anchor-id="xor">xor</h4>
<ul>
<li><code>(xor x y)</code></li>
<li><code>(xor x y &amp; r)</code></li>
</ul>
<p>Primitive boolean xor</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L555">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-zero?"></span>
</section>
<section id="zero" class="level4">
<h4 class="anchored" data-anchor-id="zero">zero?</h4>
<ul>
<li><code>(zero? x)</code></li>
</ul>
<p>Primitive and inlined <code>zero?</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/core.clj#L278">source</a></small><hr style="margin: 0"></div>
<div style="background-color:grey;height:2px;width:100%;"></div>
<div><pre><small><small>source: <a href="https://github.com/generateme/fastmath//blob/master/clay/core.clj">clay/core.clj</a></small></small></pre></div>


</section>
</section>
</section>

</main> <!-- /main -->
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
  const toggleBodyColorMode = (bsSheetEl) => {
    const mode = bsSheetEl.getAttribute("data-mode");
    const bodyEl = window.document.querySelector("body");
    if (mode === "dark") {
      bodyEl.classList.add("quarto-dark");
      bodyEl.classList.remove("quarto-light");
    } else {
      bodyEl.classList.add("quarto-light");
      bodyEl.classList.remove("quarto-dark");
    }
  }
  const toggleBodyColorPrimary = () => {
    const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
    if (bsSheetEl) {
      toggleBodyColorMode(bsSheetEl);
    }
  }
  toggleBodyColorPrimary();  
  const icon = "";
  const anchorJS = new window.AnchorJS();
  anchorJS.options = {
    placement: 'right',
    icon: icon
  };
  anchorJS.add('.anchored');
  const isCodeAnnotation = (el) => {
    for (const clz of el.classList) {
      if (clz.startsWith('code-annotation-')) {                     
        return true;
      }
    }
    return false;
  }
  const clipboard = new window.ClipboardJS('.code-copy-button', {
    text: function(trigger) {
      const codeEl = trigger.previousElementSibling.cloneNode(true);
      for (const childEl of codeEl.children) {
        if (isCodeAnnotation(childEl)) {
          childEl.remove();
        }
      }
      return codeEl.innerText;
    }
  });
  clipboard.on('success', function(e) {
    // button target
    const button = e.trigger;
    // don't keep focus
    button.blur();
    // flash "checked"
    button.classList.add('code-copy-button-checked');
    var currentTitle = button.getAttribute("title");
    button.setAttribute("title", "Copied!");
    let tooltip;
    if (window.bootstrap) {
      button.setAttribute("data-bs-toggle", "tooltip");
      button.setAttribute("data-bs-placement", "left");
      button.setAttribute("data-bs-title", "Copied!");
      tooltip = new bootstrap.Tooltip(button, 
        { trigger: "manual", 
          customClass: "code-copy-button-tooltip",
          offset: [0, -8]});
      tooltip.show();    
    }
    setTimeout(function() {
      if (tooltip) {
        tooltip.hide();
        button.removeAttribute("data-bs-title");
        button.removeAttribute("data-bs-toggle");
        button.removeAttribute("data-bs-placement");
      }
      button.setAttribute("title", currentTitle);
      button.classList.remove('code-copy-button-checked');
    }, 1000);
    // clear code selection
    e.clearSelection();
  });
  function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
    const config = {
      allowHTML: true,
      maxWidth: 500,
      delay: 100,
      arrow: false,
      appendTo: function(el) {
          return el.parentElement;
      },
      interactive: true,
      interactiveBorder: 10,
      theme: 'quarto',
      placement: 'bottom-start',
    };
    if (contentFn) {
      config.content = contentFn;
    }
    if (onTriggerFn) {
      config.onTrigger = onTriggerFn;
    }
    if (onUntriggerFn) {
      config.onUntrigger = onUntriggerFn;
    }
    window.tippy(el, config); 
  }
  const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
  for (var i=0; i<noterefs.length; i++) {
    const ref = noterefs[i];
    tippyHover(ref, function() {
      // use id or data attribute instead here
      let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
      try { href = new URL(href).hash; } catch {}
      const id = href.replace(/^#\/?/, "");
      const note = window.document.getElementById(id);
      return note.innerHTML;
    });
  }
  const xrefs = window.document.querySelectorAll('a.quarto-xref');
  const processXRef = (id, note) => {
    // Strip column container classes
    const stripColumnClz = (el) => {
      el.classList.remove("page-full", "page-columns");
      if (el.children) {
        for (const child of el.children) {
          stripColumnClz(child);
        }
      }
    }
    stripColumnClz(note)
    if (id === null || id.startsWith('sec-')) {
      // Special case sections, only their first couple elements
      const container = document.createElement("div");
      if (note.children && note.children.length > 2) {
        container.appendChild(note.children[0].cloneNode(true));
        for (let i = 1; i < note.children.length; i++) {
          const child = note.children[i];
          if (child.tagName === "P" && child.innerText === "") {
            continue;
          } else {
            container.appendChild(child.cloneNode(true));
            break;
          }
        }
        if (window.Quarto?.typesetMath) {
          window.Quarto.typesetMath(container);
        }
        return container.innerHTML
      } else {
        if (window.Quarto?.typesetMath) {
          window.Quarto.typesetMath(note);
        }
        return note.innerHTML;
      }
    } else {
      // Remove any anchor links if they are present
      const anchorLink = note.querySelector('a.anchorjs-link');
      if (anchorLink) {
        anchorLink.remove();
      }
      if (window.Quarto?.typesetMath) {
        window.Quarto.typesetMath(note);
      }
      // TODO in 1.5, we should make sure this works without a callout special case
      if (note.classList.contains("callout")) {
        return note.outerHTML;
      } else {
        return note.innerHTML;
      }
    }
  }
  for (var i=0; i<xrefs.length; i++) {
    const xref = xrefs[i];
    tippyHover(xref, undefined, function(instance) {
      instance.disable();
      let url = xref.getAttribute('href');
      let hash = undefined; 
      if (url.startsWith('#')) {
        hash = url;
      } else {
        try { hash = new URL(url).hash; } catch {}
      }
      if (hash) {
        const id = hash.replace(/^#\/?/, "");
        const note = window.document.getElementById(id);
        if (note !== null) {
          try {
            const html = processXRef(id, note.cloneNode(true));
            instance.setContent(html);
          } finally {
            instance.enable();
            instance.show();
          }
        } else {
          // See if we can fetch this
          fetch(url.split('#')[0])
          .then(res => res.text())
          .then(html => {
            const parser = new DOMParser();
            const htmlDoc = parser.parseFromString(html, "text/html");
            const note = htmlDoc.getElementById(id);
            if (note !== null) {
              const html = processXRef(id, note);
              instance.setContent(html);
            } 
          }).finally(() => {
            instance.enable();
            instance.show();
          });
        }
      } else {
        // See if we can fetch a full url (with no hash to target)
        // This is a special case and we should probably do some content thinning / targeting
        fetch(url)
        .then(res => res.text())
        .then(html => {
          const parser = new DOMParser();
          const htmlDoc = parser.parseFromString(html, "text/html");
          const note = htmlDoc.querySelector('main.content');
          if (note !== null) {
            // This should only happen for chapter cross references
            // (since there is no id in the URL)
            // remove the first header
            if (note.children.length > 0 && note.children[0].tagName === "HEADER") {
              note.children[0].remove();
            }
            const html = processXRef(null, note);
            instance.setContent(html);
          } 
        }).finally(() => {
          instance.enable();
          instance.show();
        });
      }
    }, function(instance) {
    });
  }
      let selectedAnnoteEl;
      const selectorForAnnotation = ( cell, annotation) => {
        let cellAttr = 'data-code-cell="' + cell + '"';
        let lineAttr = 'data-code-annotation="' +  annotation + '"';
        const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
        return selector;
      }
      const selectCodeLines = (annoteEl) => {
        const doc = window.document;
        const targetCell = annoteEl.getAttribute("data-target-cell");
        const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
        const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
        const lines = annoteSpan.getAttribute("data-code-lines").split(",");
        const lineIds = lines.map((line) => {
          return targetCell + "-" + line;
        })
        let top = null;
        let height = null;
        let parent = null;
        if (lineIds.length > 0) {
            //compute the position of the single el (top and bottom and make a div)
            const el = window.document.getElementById(lineIds[0]);
            top = el.offsetTop;
            height = el.offsetHeight;
            parent = el.parentElement.parentElement;
          if (lineIds.length > 1) {
            const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
            const bottom = lastEl.offsetTop + lastEl.offsetHeight;
            height = bottom - top;
          }
          if (top !== null && height !== null && parent !== null) {
            // cook up a div (if necessary) and position it 
            let div = window.document.getElementById("code-annotation-line-highlight");
            if (div === null) {
              div = window.document.createElement("div");
              div.setAttribute("id", "code-annotation-line-highlight");
              div.style.position = 'absolute';
              parent.appendChild(div);
            }
            div.style.top = top - 2 + "px";
            div.style.height = height + 4 + "px";
            div.style.left = 0;
            let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
            if (gutterDiv === null) {
              gutterDiv = window.document.createElement("div");
              gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
              gutterDiv.style.position = 'absolute';
              const codeCell = window.document.getElementById(targetCell);
              const gutter = codeCell.querySelector('.code-annotation-gutter');
              gutter.appendChild(gutterDiv);
            }
            gutterDiv.style.top = top - 2 + "px";
            gutterDiv.style.height = height + 4 + "px";
          }
          selectedAnnoteEl = annoteEl;
        }
      };
      const unselectCodeLines = () => {
        const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
        elementsIds.forEach((elId) => {
          const div = window.document.getElementById(elId);
          if (div) {
            div.remove();
          }
        });
        selectedAnnoteEl = undefined;
      };
        // Handle positioning of the toggle
    window.addEventListener(
      "resize",
      throttle(() => {
        elRect = undefined;
        if (selectedAnnoteEl) {
          selectCodeLines(selectedAnnoteEl);
        }
      }, 10)
    );
    function throttle(fn, ms) {
    let throttle = false;
    let timer;
      return (...args) => {
        if(!throttle) { // first call gets through
            fn.apply(this, args);
            throttle = true;
        } else { // all the others get throttled
            if(timer) clearTimeout(timer); // cancel #2
            timer = setTimeout(() => {
              fn.apply(this, args);
              timer = throttle = false;
            }, ms);
        }
      };
    }
      // Attach click handler to the DT
      const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
      for (const annoteDlNode of annoteDls) {
        annoteDlNode.addEventListener('click', (event) => {
          const clickedEl = event.target;
          if (clickedEl !== selectedAnnoteEl) {
            unselectCodeLines();
            const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
            if (activeEl) {
              activeEl.classList.remove('code-annotation-active');
            }
            selectCodeLines(clickedEl);
            clickedEl.classList.add('code-annotation-active');
          } else {
            // Unselect the line
            unselectCodeLines();
            clickedEl.classList.remove('code-annotation-active');
          }
        });
      }
  const findCites = (el) => {
    const parentEl = el.parentElement;
    if (parentEl) {
      const cites = parentEl.dataset.cites;
      if (cites) {
        return {
          el,
          cites: cites.split(' ')
        };
      } else {
        return findCites(el.parentElement)
      }
    } else {
      return undefined;
    }
  };
  var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
  for (var i=0; i<bibliorefs.length; i++) {
    const ref = bibliorefs[i];
    const citeInfo = findCites(ref);
    if (citeInfo) {
      tippyHover(citeInfo.el, function() {
        var popup = window.document.createElement('div');
        citeInfo.cites.forEach(function(cite) {
          var citeDiv = window.document.createElement('div');
          citeDiv.classList.add('hanging-indent');
          citeDiv.classList.add('csl-entry');
          var biblioDiv = window.document.getElementById('ref-' + cite);
          if (biblioDiv) {
            citeDiv.innerHTML = biblioDiv.innerHTML;
          }
          popup.appendChild(citeDiv);
        });
        return popup.innerHTML;
      });
    }
  }
});
</script>
<nav class="page-navigation">
  <div class="nav-page nav-page-previous">
      <a href="./index.html" class="pagination-link" aria-label="Preface">
        <i class="bi bi-arrow-left-short"></i> <span class="nav-page-text">Preface</span>
      </a>          
  </div>
  <div class="nav-page nav-page-next">
      <a href="./vector_matrix.html" class="pagination-link" aria-label="Vectors and matrices">
        <span class="nav-page-text">Vectors and matrices</span> <i class="bi bi-arrow-right-short"></i>
      </a>
  </div>
</nav>
</div> <!-- /content -->




</body></html>